static public void StartDeviceListMonitor() { IVciDeviceManager deviceManager = null; IVciDeviceList deviceList = null; deviceManager = VciServer.Instance().DeviceManager; deviceList = deviceManager.GetDeviceList(); ARE_Devices = new AutoResetEvent(true); //true запустит метод сразу deviceList.AssignEvent(ARE_Devices); ARE_Thread = new Thread(ARE_Thread_Devices); ARE_Thread.Start(); }
private CanManager() { _connectionEvent = new AutoResetEvent(true); using (IVciDeviceManager deviceManager = VciServer.Instance().DeviceManager) { _deviceList = deviceManager.GetDeviceList(); _deviceList.AssignEvent(_connectionEvent); } Thread t = new Thread(ConnectionThread); t.IsBackground = true; t.Start(); }