示例#1
0
        private async void Init()
        {
            hubConnection = new HubConnection("http://localhost:5225");
            proxy = hubConnection.CreateHubProxy("MyHub");
            await hubConnection.Start();

            proxy.On<string>("executeCommand", (data) =>
            {
                Debug.WriteLine(data);
               // var message = Newtonsoft.Json.JsonConvert.DeserializeObject<Message>(data.ToString());
            });

            qmhubConnection = new HubConnection("http://quantifymewebhub.azurewebsites.net/");
            qmproxy = qmhubConnection.CreateHubProxy("QuantifyMeHub");
            await qmhubConnection.Start();

            qmproxy.On<string,string>("send", (name, data) =>
            {
                Debug.WriteLine(data);
                var message = new Message { Source = "RemoteUWP", Action = "UpdateData", Value = data };

                proxy.Invoke("Send", Newtonsoft.Json.JsonConvert.SerializeObject(message));

            });
        }
示例#2
0
        private void Slide2Demo_Click(object sender, RoutedEventArgs e)
        {
            var message = new Message { Source = "RemoteUWP", Action = "Animate", Value = "Slide2Demo" };

            proxy.Invoke("Send", Newtonsoft.Json.JsonConvert.SerializeObject(message));
        }
示例#3
0
        private void submitRate_Click(object sender, RoutedEventArgs e)
        {
            var message = new Message { Source = "RemoteUWP", Action = "UpdateData", Value = rate.Text };

            proxy.Invoke("Send", Newtonsoft.Json.JsonConvert.SerializeObject(message));
        }