private void DestroyComportMonitoring() { if (SerialPortMonitor != null) { SerialPortMonitor.ComportEventOccured -= OnComPortEventReceived; SerialPortMonitor.StopMonitoring(); } }
public void Initialize() { DeviceEventReceived = OnDeviceEventReceived; ComPortEventReceived = OnComPortEventReceived; SerialPortMonitor.ComportEventOccured += OnComPortEventReceived; SerialPortMonitor.StartMonitoring(); StateActionRules = new StateActionRules(); DeviceConfigurationProvider.InitializeConfiguration(); Configuration = DeviceConfigurationProvider.GetAppConfig(); //LoggingClient = LoggingServiceClientProvider.GetLoggingServiceClient(); //Connector = ListenerConnectorProvider.GetConnector(DeviceConfigurationProvider.GetConfiguration()); stateActionController = DeviceStateActionControllerProvider.GetStateActionController(this); InitializeConnectorEvents(); }