示例#1
0
        private void _SetStatuses()
        {
            //Determine if PS3 tablet exists
              if (PS3InputDevice.IsDetected())
              {
            grpPS3.Enabled = true;
            lblPS3Tablet.ForeColor = Color.Green;
              }
              else
              {
            grpPS3.Enabled = false;
              }

              flpWiiTablets.Controls.Clear();
              if (WiiInputDevice.IsDetected())
              {
            foreach (var tablet in MouseInterface.Tablets)
            {
              var wiiTablet = tablet.Tablet as WiiInputDevice;
              if (wiiTablet != null)
              {
            var ctl = new WiiTabletDevice(wiiTablet.Index.GetValueOrDefault());
            flpWiiTablets.Controls.Add(ctl);
            ctl.Anchor = AnchorStyles.Left | AnchorStyles.Right;
            ctl.ButtonClicked += btnSlotSettings_Click;
              }
            }
              }

              //Determine if 360 wireless receiver is connected
              if (MouseInterface.Receiver != null && MouseInterface.Receiver.IsReceiverConnected)
              {
            grp360.Enabled = true;
            lbl360Receiver.ForeColor = Color.Green;

            foreach (var slot in _slots)
            {
              if (MouseInterface.Receiver.IsDeviceConnected(slot.Index))
              {
            var description = "N/A";
            var info = MouseInterface.Receiver.GetDeviceInformation(slot.Index);
            if (info != null)
            {
              switch (info.Subtype)
              {
                case Xbox360USB.WirelessReceiver.DeviceSubtype.Controller:
                  {
                    description = "Controller: " + info.ToString();
                    break;
                  }
                case Xbox360USB.WirelessReceiver.DeviceSubtype.uDrawTablet:
                  {
                    description = "uDraw GameTablet: " + info.ToString();
                    break;
                  }
                default:
                  description = "Unknown Device";
                  break;
              }
            }

            slot.Label.ForeColor = Color.Green;
            slot.Label.Text = String.Format("Slot {0}: {1}", slot.Index, description);
            slot.Button.Enabled = true;
              }
              else
              {
            slot.Label.ForeColor = Color.Red;
            slot.Label.Text = String.Format("Slot {0}: N/A", slot.Index);
            slot.Button.Enabled = false;
              }
            }
              }
              else
              {
            grp360.Enabled = false;
              }
        }
示例#2
0
        private void _SetStatuses()
        {
            //Determine if PS3 tablet exists
            if (PS3InputDevice.IsDetected())
            {
                grpPS3.Enabled         = true;
                lblPS3Tablet.ForeColor = Color.Green;
            }
            else
            {
                grpPS3.Enabled = false;
            }

            flpWiiTablets.Controls.Clear();
            if (WiiInputDevice.IsDetected())
            {
                foreach (var tablet in MouseInterface.Tablets)
                {
                    var wiiTablet = tablet.Tablet as WiiInputDevice;
                    if (wiiTablet != null)
                    {
                        var ctl = new WiiTabletDevice(wiiTablet.Index.GetValueOrDefault());
                        flpWiiTablets.Controls.Add(ctl);
                        ctl.Anchor         = AnchorStyles.Left | AnchorStyles.Right;
                        ctl.ButtonClicked += btnSlotSettings_Click;
                    }
                }
            }

            //Determine if 360 wireless receiver is connected
            if (MouseInterface.Receiver != null && MouseInterface.Receiver.IsReceiverConnected)
            {
                grp360.Enabled           = true;
                lbl360Receiver.ForeColor = Color.Green;

                foreach (var slot in _slots)
                {
                    if (MouseInterface.Receiver.IsDeviceConnected(slot.Index))
                    {
                        var description = "N/A";
                        var info        = MouseInterface.Receiver.GetDeviceInformation(slot.Index);
                        if (info != null)
                        {
                            switch (info.Subtype)
                            {
                            case Xbox360USB.WirelessReceiver.DeviceSubtype.Controller:
                            {
                                description = "Controller: " + info.ToString();
                                break;
                            }

                            case Xbox360USB.WirelessReceiver.DeviceSubtype.uDrawTablet:
                            {
                                description = "uDraw GameTablet: " + info.ToString();
                                break;
                            }

                            default:
                                description = "Unknown Device";
                                break;
                            }
                        }

                        slot.Label.ForeColor = Color.Green;
                        slot.Label.Text      = String.Format("Slot {0}: {1}", slot.Index, description);
                        slot.Button.Enabled  = true;
                    }
                    else
                    {
                        slot.Label.ForeColor = Color.Red;
                        slot.Label.Text      = String.Format("Slot {0}: N/A", slot.Index);
                        slot.Button.Enabled  = false;
                    }
                }
            }
            else
            {
                grp360.Enabled = false;
            }
        }