public static VBEEvents Initialize(IVBE vbe) { lock (Lock) { if (_instance == null) { _instance = new VBEEvents(vbe); } } return(_instance); }
public static void Terminate() { lock (Lock) { if (_instance == null) { return; } _instance.Dispose(); _instance = null; } }
public static void UnhookEvents() { lock (ThreadLock) { User32.UnhookWinEvent(_eventHandle); foreach (var info in TrackedWindows.Values) { info.Subclass.FocusChange -= FocusDispatcher; info.Subclass.Dispose(); } VBEEvents.Terminate(); } }
public static void UnhookEvents() { lock (ThreadLock) { SelectionChanged = delegate { }; IntelliSenseChanged = delegate { }; KeyDown = delegate { }; WindowFocusChange = delegate { }; User32.UnhookWinEvent(_eventHandle); Subclasses.Dispose(); VBEEvents.Terminate(); _vbe = null; } }