/// <summary> /// Disable the object editor. /// </summary> public void Disable() { if (!enabled) { return; } hotKeyWatch.HotKeyPressed -= new EventHandler(hotKeyWatch_HotKeyPressed); hotKeyWatch.UnregisterKey(); hotKeyWatch = null; enabled = false; Trace.WriteLine("ObjectEditor disabled."); }
/// <summary> /// Disable the object editor. /// </summary> public void Disable() { if (!_enabled) { return; } _hotKeyWatch.HotKeyPressed -= hotKeyWatch_HotKeyPressed; _hotKeyWatch.UnregisterKey(); _hotKeyWatch = null; _enabled = false; Trace.WriteLine("ObjectEditor disabled."); }
/// <summary> /// Enable the Object Editor to listen for the shortcut key. /// </summary> /// <returns></returns> public bool Enable() { if (enabled) { return(true); // already enabled. } hotKeyWatch = new HotKeyWatch(); if (!hotKeyWatch.RegisterHotKey(hotKey)) { return(false); // didn't work } hotKeyWatch.HotKeyPressed += new EventHandler(hotKeyWatch_HotKeyPressed); enabled = true; Trace.WriteLine("ObjectEditor enabled on shorcut:" + hotKey); return(true); }
/// <summary> /// Enable the Object Editor to listen for the shortcut key. /// </summary> /// <returns></returns> public bool Enable() { if (_enabled) { return(true); // already enabled. } _hotKeyWatch = new HotKeyWatch(); if (!_hotKeyWatch.RegisterHotKey(HotKey)) { return(false); // didn't work } _hotKeyWatch.HotKeyPressed += hotKeyWatch_HotKeyPressed; _enabled = true; Trace.WriteLine("ObjectEditor enabled on shorcut:" + HotKey); return(true); }
/// <summary> /// Enable the Object Editor to listen for the shortcut key. /// </summary> /// <returns></returns> public void EnableHotKey() { if (hotKeyEnabled) { return; // already enabled. } string hotKey = CoreApplicationOptions.Instance.HotKey; if (string.IsNullOrEmpty(hotKey)) { return; } hotKeyWatch = new HotKeyWatch(); if (!hotKeyWatch.RegisterHotKey(hotKey)) { return; // didn't work } hotKeyWatch.HotKeyPressed += new EventHandler(hotKeyWatch_HotKeyPressed); hotKeyEnabled = true; Trace.WriteLine("ObjectEditor's hotkey enabled: " + hotKey); }