示例#1
0
 private void OnCharacteristicSelected(object sender, SelectionChangedEventArgs e)
 {
     if (e.AddedItems.Count > 0)
     {
         selectedCharacteristic = (GattCharacteristic)((Entity)e.AddedItems[0]).Item;
         if (selectedCharacteristic != null)
         {
             enuminator.Hide();
             enuminator = null;
             Status     = "Connected";
             OnConnect(this, new ConnectEventArgs("Success"));
         }
     }
 }
示例#2
0
 private void DeviceSelected(object sender, SelectionChangedEventArgs e)
 {
     enuminator.Hide();
     if (e.AddedItems.Count > 0)
     {
         kinectSensor = (KinectSensor)((Entity)e.AddedItems[0]).Item;
         if (kinectSensor.Status == KinectStatus.Connected)
         {
             Name = kinectSensor.UniqueKinectId;
             OnConnect(this, new ConnectEventArgs("Success"));
             return;
         }
     }
     else
     {
         OnConnect(this, new ConnectEventArgs("Error", "No Kinect Devices Selected."));
         return;
     }
     OnConnect(this, new ConnectEventArgs("Error", "Unable to connect to Kinect."));
 }