/// <summary> /// Creates a new ConfigFile watcher that monitors the configuration file for changes. /// </summary> public AdmConfigMonitor() { ConfigWatcher = new FileSystemWatcher { Path = AdmConfigBuilder.ConfigDir, Filter = Path.GetFileName(AdmConfigBuilder.ConfigFilePath), NotifyFilter = NotifyFilters.LastWrite }; LocationDataWatcher = new FileSystemWatcher { Path = AdmConfigBuilder.ConfigDir, Filter = Path.GetFileName(AdmConfigBuilder.LocationDataPath), NotifyFilter = NotifyFilters.LastWrite }; ScriptConfigWatcher = new() { Path = AdmConfigBuilder.ConfigDir, Filter = Path.GetFileName(AdmConfigBuilder.ScriptConfigPath), NotifyFilter = NotifyFilters.LastWrite }; ScriptConfigWatcher.Changed += OnChangedScriptConfig; ConfigWatcher.Changed += OnChangedConfig; LocationDataWatcher.Changed += OnChangedLocationData; IConfigUpdateEvent <AdmConfig> geolocatorEvent = new GeolocatorEvent(); IConfigUpdateEvent <AdmConfig> themeModeEvent = new ThemeModeEvent(componentManager); IConfigUpdateEvent <AdmConfig> hotkeyEvent = new HotkeyEvent(); //change event trackers builder.ConfigUpdatedHandler += geolocatorEvent.OnConfigUpdate; builder.ConfigUpdatedHandler += themeModeEvent.OnConfigUpdate; builder.ConfigUpdatedHandler += hotkeyEvent.OnConfigUpdate; }
public HotkeyBarItem(ConsoleKey key, string keytext, string name, HotkeyEvent handler, int gridPosition) { this.TriggerKey = key; this.TriggerKeyDisplayName = keytext; this.ItemName = name; this.EventHandler = handler; this.Enabled = true; this.Visible = true; this.GridPosition = gridPosition; }
public HotkeyBarItem(ConsoleKey key, string name, HotkeyEvent handler, int gridPosition) : this(key, key.ToString(), name, handler, gridPosition) { }
public HotkeyBarItem(ConsoleKey key, string keytext, string name, HotkeyEvent handler) : this(key, keytext, name, handler, -1) { }
public HotkeyBarItem(ConsoleKey key, string name, HotkeyEvent handler) : this(key, key.ToString(), name, handler) { }