Beispiel #1
0
 private void DeviceListBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (DeviceListBox.SelectedItem is Device device)
     {
         //上一个线程如果没完成就强制结束
         _lastConnectThread?.Abort();
         _lastConnectThread = Client.StartAction(() =>
         {
             //加锁,避免出现线程安全问题
             lock ("connect")
             {
                 //连接屏幕
                 MyMirrorScreen.Connect(device);
             }
         });
         RunningModules.ItemsSource = device.RunningModules;
         var rmmd5list = from rm in device.RunningModules select rm.Md5;
         foreach (var m in Client.Modules)
         {
             if (rmmd5list.Contains(m.Md5))
             {
                 m.State = 1;
             }
             else
             {
                 m.State = 0;
             }
         }
     }
     else
     {
         MyMirrorScreen.Disconnect();
     }
 }
Beispiel #2
0
 private void Btn_home(object sender, RoutedEventArgs e)
 {
     if (Client.BatchControl)
     {
         Client.CallBatchControlEnvent(new JObject {
             ["type"] = "device_button", ["name"] = "code", ["key"] = 3
         });
     }
     else
     {
         MyMirrorScreen.EmitEvent(new JObject {
             ["type"] = "device_button", ["name"] = "code", ["key"] = 3
         });
     }
 }
Beispiel #3
0
 private void DeviceListBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (DeviceListBox.SelectedItem is Device device)
     {
         //上一个线程如果没完成就强制结束
         _lastConnectThread?.Abort();
         _lastConnectThread = Client.StartAction(() =>
         {
             //加锁,避免出现线程安全问题
             lock ("connect")
             {
                 //连接屏幕
                 MyMirrorScreen.Connect(device);
             }
         });
     }
 }
Beispiel #4
0
 private void Btn_task(object sender, RoutedEventArgs e)
 {
     MyMirrorScreen.EmitEvent(new JObject {
         ["type"] = "device_button", ["name"] = "code", ["key"] = 187
     });
 }