/// <summary> /// Constructor of the class. /// </summary> public GlobalKeyBackgroundListener() { InitializeComponent(); // Initialize the HotkeyList _hotKeys = new List<GlobalHotkey>(); _hotkeyConfigurationWindow = new HotkeyConfigurationWindow(); // Init configuredHotkey _configuredHotkeys = new XmlConfiguredHotkeys(new HotkeyXmlConfigurationPath()); // Init Plugins var loadPlugins = new GlobalHotkeyManagerLoadPlugins(new HotkeyManagerPluginsPath()); _plugins = loadPlugins.Plugins; // Init Startup Manager & KeyInfos var startupKey = new StartupRegistryKey(); _applicationStartupManager = new CurrentApplicationStartupManager(startupKey); var registryKeyInfo = new GlobalHotkeyManagerAutostartRegistryKeyInfo(startupKey); // Check Autostart if already Registered string registryValue; if (registryKeyInfo.TryGetValue(out registryValue)) { _autostartMenueItem.Checked = true; } // EventHandler Shown += BackgroundListenerFromShow; FormClosing += BackgroundListenerFromClosing; _trayNotification.DoubleClick += DoubleClickTrayIcon; }
/// <summary> /// Constructor /// </summary> public HotkeyConfigurationWindow() { InitializeComponent(); // Init Collections ConfiguredHotkeys = new ObservableCollection<HotkeyConfiguration>(); // Init XmlConfigurations _xmlConfiguredHotkeys = new XmlConfiguredHotkeys(new HotkeyXmlConfigurationPath()); // Init PluginLoader _hotKeyPlugins = new GlobalHotkeyManagerLoadPlugins(new HotkeyManagerPluginsPath()); // Bindings ConfiguredKeyDataGrid.ItemsSource = ConfiguredHotkeys; // Load already configured Hotkeys LoadXmlHotKeys(); // Load Dropdown Menues LoadDropDowns(); }