private void ConfigurationInitializationComplete(object sender, EventArgs e) { _configManager.InitializationComplete -= ConfigurationInitializationComplete; if (_zWaveManager == null) { _zWaveManager = new ZWaveManager(); } if (_zWaveOptions == null) { _zWaveOptions = new ZWaveOptions(); } String optionsDirectory; if (Assembly.GetEntryAssembly() == null) { optionsDirectory = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "ZWave"); } else { optionsDirectory = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "ZWave"); } _zWaveOptions.Create(optionsDirectory, optionsDirectory, ""); _zWaveOptions.Lock(); _zWaveManager.Create(); _zWaveManager.AddDriver(_configManager.ZWaveCOM, ZWControllerInterface.Serial); _zWaveManager.OnNotification += NotificationRecieved; _zWaveManager.OnControllerStateChanged += ControllerStateChanged; }
public ZWaveController(IInternalConfigurationManager configManager, IZWaveManager zWaveManager, IZWaveOptions zWaveOptions) : this(configManager) { _zWaveManager = zWaveManager; _zWaveOptions = zWaveOptions; }