public void Initialize(DeviceComponent model)
        {
            _model = model as ButtonDeviceComponent;

            if (_model == null)
                throw new ApplicationException();

            chkButton.Text = _model.Name;
        }
        public MouseDevice()
        {
            _mouse = new MouseHook();

            _left = new ButtonDeviceComponent(this) { Name = "Left", State = ButtonState.Up };
            _right = new ButtonDeviceComponent(this) { Name = "Right", State = ButtonState.Up };
            _middle = new ButtonDeviceComponent(this) { Name = "Middle", State = ButtonState.Up };

            _wheel = new DeltaDeviceComponent(this) { Name = "Wheel" };

            _cursor = new PositionalDeviceComponent(this) { Name = "Cursor" };
        }
        public WiimoteDevice()
        {
            _wiimote = new WiimoteLib.Wiimote();

            _buttonA = new ButtonDeviceComponent(this) { Name = "A" };
            _buttonB = new ButtonDeviceComponent(this) { Name = "B" };
            _buttonMinus = new ButtonDeviceComponent(this) { Name = "Minus" };
            _buttonPlus = new ButtonDeviceComponent(this) { Name = "Plus" };
            _buttonUp = new ButtonDeviceComponent(this) { Name = "Up" };
            _buttonDown = new ButtonDeviceComponent(this) { Name = "Down" };
            _buttonLeft = new ButtonDeviceComponent(this) { Name = "Left" };
            _buttonRight = new ButtonDeviceComponent(this) { Name = "Right" };
            _button1 = new ButtonDeviceComponent(this) { Name = "1" };
            _button2 = new ButtonDeviceComponent(this) { Name = "2" };
            _buttonHome = new ButtonDeviceComponent(this) { Name = "Home" };

            _classicUp = new ButtonDeviceComponent(this) { Name = "Classic Up" };
            _classicDown = new ButtonDeviceComponent(this) { Name = "Classic Down" };
            _classicLeft = new ButtonDeviceComponent(this) { Name = "Classic Left" };
            _classicRight = new ButtonDeviceComponent(this) { Name = "Classic Right" };

            _irComponent = new PositionalDeviceComponent(this) { Name = "IR" };
            _accelerometer = new AccelerometerDeviceComponent(this) { Name = "Accelerometer" };
        }
        public GamePadDevice()
        {
            _buttonA = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "A" };
            _buttonB = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "B" };
            _buttonX = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "X" };
            _buttonY = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Y" };
            _buttonUp = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Up" };
            _buttonDown = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Down" };
            _buttonLeft = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Left" };
            _buttonRight = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Right" };
            _buttonLeftShoulder = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Left Shoulder" };
            _buttonRightShoulder = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Right Shoulder" };
            _buttonLeftStick = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Left Stick" };
            _buttonRightStick = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Right Stick" };
            _buttonBack = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Back" };
            _buttonStart = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Start" };
            _buttonCenter = new ButtonDeviceComponent(this) { State = UxbTransform.DeviceComponents.ButtonState.Up, Name = "Center" };

            _leftStick = new JoystickDeviceComponent(this) { XAxis = 0.0f, YAxis = 0.0f, Name = "Left Analog" };
            _rightStick = new JoystickDeviceComponent(this) { XAxis = 0.0f, YAxis = 0.0f, Name = "Right Analog" };

            _leftTrigger = new TriggerDeviceComponent(this) { Name = "Left Trigger" };
            _rightTrigger = new TriggerDeviceComponent(this) { Name = "Right Trigger" };
        }
 private Boolean ButtonChanged(Microsoft.Xna.Framework.Input.ButtonState buttonState, ButtonDeviceComponent _buttonA)
 {
     if (buttonState == Microsoft.Xna.Framework.Input.ButtonState.Pressed)
         return _buttonA.State == UxbTransform.DeviceComponents.ButtonState.Down ? false : true;
     else
         return _buttonA.State == UxbTransform.DeviceComponents.ButtonState.Up ? false : true;
 }