/// <summary>
        /// Connections the specified object.
        /// </summary>
        /// <param name="obj">The object.</param>
        private void Connection(object obj)
        {
            if (null != obj)
            {
                var state = (bool)obj;
                if (!state)
                {
                    Manipulator?.Disconnect();
                }
                else
                {
                    if (string.IsNullOrEmpty(SelectedCOMPort))
                    {
                        BadgeText = "!";
                        ConnectionToggleIsChecked = false;
                        return;
                    }

                    ConnectionToggleIsChecked = true;
                    Manipulator = new E3JManipulator(Settings);
                    Manipulator.Port.ConnectionStatusChanged += Port_ConnectionStatusChanged;
                    Manipulator.Connect(SelectedCOMPort);
                    Manipulator.Port.DataReceived += Port_DataReceived;
                    KinectHandler?.StartKinect(Manipulator);
                }
            }
        }
 private async void Connection(object obj)
 {
     if (null != obj)
     {
         var state = (bool)obj;
         if (!state)
         {
             Manipulator?.Disconnect();
         }
         else
         {
             Manipulator = new E3JManipulator(Settings);
             Manipulator.Connect(SelectedCOMPort);
         }
     }
 }
Beispiel #3
0
        private async void Connection(object obj)
        {
            if (null != obj)
            {
                var state = (bool)obj;
                if (!state)
                {
                    Manipulator?.Disconnect();
                }
                else
                {
                    if (string.IsNullOrEmpty(SelectedCOMPort))
                    {
                        BadgeText = "!";
                        ConnectionToggleIsChecked = false;
                        return;
                    }

                    ConnectionToggleIsChecked = true;
                    Manipulator = new E3JManipulator(Settings);
                    Manipulator.Connect(SelectedCOMPort);
                }
            }
        }