1 using Tizen.Applications;
\r
4 using Tizen.Applications.Messages;
\r
6 namespace MsgPortApp1.Tizen
\r
8 class App : CoreUIApplication
\r
10 private static MessagePort _remotePort;
\r
11 private Bundle _confirmMsg;
\r
12 private static string TAG;
\r
13 protected override void OnCreate()
\r
18 _confirmMsg = new Bundle();
\r
19 _confirmMsg.AddItem("ConfirmMessage", "Message is received");
\r
20 TAG = "MSGPORTAPP1";
\r
22 Log.Debug(TAG, "@@@@@@@ Create");
\r
23 _remotePort = new MessagePort("RemotePort", false);
\r
24 Log.Debug(TAG, "@@@@@@@ MessagePort-MsgPortApp1 Create : " + _remotePort.PortName + "Trusted : " + _remotePort.Trusted);
\r
26 _remotePort.MessageReceived += MessageReceived_Callback;
\r
27 _remotePort.Listen();
\r
32 Window window = new Window("ElmSharpApp")
\r
34 AvailableRotations = DisplayRotation.Degree_0 | DisplayRotation.Degree_180 | DisplayRotation.Degree_270 | DisplayRotation.Degree_90
\r
36 window.BackButtonPressed += (s, e) =>
\r
42 var box = new Box(window)
\r
51 var bg = new Background(window)
\r
57 var conformant = new Conformant(window);
\r
59 conformant.SetContent(bg);
\r
61 var label = new Label(window)
\r
63 Text = "Hello, Tizen",
\r
69 private void MessageReceived_Callback(object sender, MessageReceivedEventArgs e)
\r
71 Log.Debug(TAG, "@@@@@@@ Message Received");
\r
72 Log.Debug(TAG, "@@@@@@@ App ID : " + e.Remote.AppId);
\r
73 Log.Debug(TAG, "@@@@@@@ PortName : " + e.Remote.PortName);
\r
74 Log.Debug(TAG, "@@@@@@@ Trusted : " + e.Remote.Trusted);
\r
75 Log.Debug(TAG, "@@@@@@@ message: " + e.Message.GetItem<string>("message"));
\r
77 _remotePort.Send(_confirmMsg, "Tizen.Applications.Tests", "LocalPort");
\r
80 static void Main(string[] args)
\r
82 Elementary.Initialize();
\r
83 Elementary.ThemeOverlay();
\r
84 App app = new App();
\r