/// <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> /// 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."); }