public void Initialize(DeviceComponent model) { _model = model as PositionalDeviceComponent; if (_model == null) throw new ApplicationException(); lblName.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" }; }