示例#1
0
        public static VBEEvents Initialize(IVBE vbe)
        {
            lock (Lock)
            {
                if (_instance == null)
                {
                    _instance = new VBEEvents(vbe);
                }
            }

            return(_instance);
        }
示例#2
0
        public static void Terminate()
        {
            lock (Lock)
            {
                if (_instance == null)
                {
                    return;
                }

                _instance.Dispose();
                _instance = null;
            }
        }
示例#3
0
 public static void UnhookEvents()
 {
     lock (ThreadLock)
     {
         User32.UnhookWinEvent(_eventHandle);
         foreach (var info in TrackedWindows.Values)
         {
             info.Subclass.FocusChange -= FocusDispatcher;
             info.Subclass.Dispose();
         }
         VBEEvents.Terminate();
     }
 }
示例#4
0
 public static void UnhookEvents()
 {
     lock (ThreadLock)
     {
         SelectionChanged    = delegate { };
         IntelliSenseChanged = delegate { };
         KeyDown             = delegate { };
         WindowFocusChange   = delegate { };
         User32.UnhookWinEvent(_eventHandle);
         Subclasses.Dispose();
         VBEEvents.Terminate();
         _vbe = null;
     }
 }