// It is called when a message is received. private static void OnMessageReceived(object sender, TypedRequestReceivedEventArgs <MyRequest> e) { Console.WriteLine("Received: " + e.RequestMessage.Text); // Create the response message. MyResponse aResponse = new MyResponse(); aResponse.Length = e.RequestMessage.Text.Length; // Send the response message back to the client. myReceiver.SendResponseMessage(e.ResponseReceiverId, aResponse); String msg = e.RequestMessage.Text; if (msg.Equals("Open")) { Console.WriteLine("Simulate Open Action"); //MainWindow.simulateOpenAction(); } else if (msg.Equals("Close")) { Console.WriteLine("Simulate Close Action"); // MainWindow.simulateCloseAction(); } }
// It is called when a message is received. private static void OnMessageReceived(object sender, TypedRequestReceivedEventArgs<MyRequest> e) { Console.WriteLine("Received: " + e.RequestMessage.Text); // Create the response message. MyResponse aResponse = new MyResponse(); aResponse.Length = e.RequestMessage.Text.Length; // Send the response message back to the client. myReceiver.SendResponseMessage(e.ResponseReceiverId, aResponse); }
// It is called when a message is received. private static void OnMessageReceived(object sender, TypedRequestReceivedEventArgs <MyRequest> e) { Console.WriteLine("Jumlah PC : " + e.RequestMessage.Text); Console.WriteLine("Waktu Mulai : " + e.RequestMessage.Text2); Console.WriteLine("Lama Pemakaian : " + e.RequestMessage.Text3); // Create the response message. MyResponse aResponse = new MyResponse(); //aResponse.Length = e.RequestMessage.Text.Length; // Send the response message back to the client. myReceiver.SendResponseMessage(e.ResponseReceiverId, aResponse); }