コード例 #1
0
        /// <summary>
        /// Start using the device.
        /// </summary>
        public override void Start()
        {
            try
            {
                DebugOpen("MicrosoftMceTransceiver_DriverReplacement.log");
                DebugWriteLine("Start()");
                DebugWriteLine("Device Guid: {0}", _deviceGuid);
                DebugWriteLine("Device Path: {0}", _devicePath);
                DebugWriteLine("Device Type: {0}", Enum.GetName(typeof(DeviceType), _deviceType));

                _notifyWindow = new NotifyWindow();
                _notifyWindow.Create();
                _notifyWindow.Class = _deviceGuid;
                _notifyWindow.RegisterDeviceArrival();

                OpenDevice();
                StartReadThread();
                InitializeDevice();

                _notifyWindow.DeviceArrival += OnDeviceArrival;
                _notifyWindow.DeviceRemoval += OnDeviceRemoval;
            }
            catch
            {
                DebugClose();
                throw;
            }
        }
コード例 #2
0
ファイル: DriverVista.cs プロジェクト: Azzuro/IR-Server-Suite
    /// <summary>
    /// Starts listening for messages from the device.
    /// </summary>
    void StartDevice()
    {
      lock (_startStopLock)
      {
        _notifyWindow = new NotifyWindow();
        _notifyWindow.Create();
        _notifyWindow.Class = _deviceGuid;
        _notifyWindow.RegisterDeviceArrival();

        OpenDevice();
        InitializeDevice();

        StartReadThread(ReadThreadMode.Receiving);

        _notifyWindow.DeviceArrival += OnDeviceArrival;
        _notifyWindow.DeviceRemoval += OnDeviceRemoval;
      }
    }
コード例 #3
0
    /// <summary>
    /// Start using the device.
    /// </summary>
    public override void Start()
    {
      try
      {
        DebugOpen("MicrosoftMceTransceiver_DriverReplacement.log");
        DebugWriteLine("Start()");
        DebugWriteLine("Device Guid: {0}", _deviceGuid);
        DebugWriteLine("Device Path: {0}", _devicePath);
        DebugWriteLine("Device Type: {0}", Enum.GetName(typeof (DeviceType), _deviceType));

        _notifyWindow = new NotifyWindow();
        _notifyWindow.Create();
        _notifyWindow.Class = _deviceGuid;
        _notifyWindow.RegisterDeviceArrival();

        OpenDevice();
        StartReadThread();
        InitializeDevice();

        _notifyWindow.DeviceArrival += OnDeviceArrival;
        _notifyWindow.DeviceRemoval += OnDeviceRemoval;
      }
      catch
      {
        DebugClose();
        throw;
      }
    }