Exemple #1
0
        public MainWindowViewModel()
        {
            var vGenWrapper = new VGenWrapper();

            HidManager      = new HidManager();
            _gamepadManager = new GamepadManager(vGenWrapper, HidManager);
            _gamepadManager.ErrorOccuredEvent += (_, message) => { Log(message); };

            IsRunning.AsObservable().Where(b => !b).Subscribe(_ => _runningGamepadsDisposable?.Dispose());
        }
        public HidToSerialModuleUI()
        {
            InitializeComponent();

            hidToSerialDevice = new HidToSerialDevice(0x1FBD, 0x0005);
            hidToSerialDevice.HidDevice.OnDeviceAttached += new EventHandler(hidDevice1_OnDeviceAttached);
            hidToSerialDevice.HidDevice.OnDeviceRemoved  += new EventHandler(hidDevice1_OnDeviceRemoved);
            hidToSerialDevice.HidDevice.OnReportReceived += hidDevice_OnReportReceived;
            hidToSerialDevice.HidDevice.Connect();

            hostTransmissionTypeComboBox.DataSource = Enum.GetNames(typeof(HostTransmisionType));

            foreach (HidDevice hidDevice in HidManager.GetDeviceList())
            {
                hidDeviceListComboBox.Items.Add(hidDevice.ProductName + " - (VID: " + hidDevice.VendorID + ", PID: " + hidDevice.ProductID + ")");
            }
        }
 public SimplifiedHidPreview()
 {
     HidManager      = new HidManager();
     CurrentHidState = new ReactiveProperty <string>("");
 }