コード例 #1
0
ファイル: MainPage.xaml.cs プロジェクト: valeryjacobs/TIMTLTS
        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
ファイル: MainPage.xaml.cs プロジェクト: valeryjacobs/TIMTLTS
        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
ファイル: MainPage.xaml.cs プロジェクト: valeryjacobs/TIMTLTS
        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));
        }