コード例 #1
0
        private static void ReadviseWindowFrameEvents(IVsUIShell7 vsUIShell, DTE dte)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            if (Cookie is uint cookie)
            {
                // Ensure that we only have one event sink installed for the app domain if initialize is called
                // multiple times while testing.
                vsUIShell.UnadviseWindowFrameEvents(cookie);
            }

            Cookie = vsUIShell.AdviseWindowFrameEvents(new StartPageExtender(dte, (IVsUIShell)vsUIShell));
        }
コード例 #2
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            ThreadHelper.ThrowIfNotOnUIThread();

            if (disposing && uiShell7 != null)
            {
                page.NameChanged -= NameChanged;
                uiShell7.UnadviseWindowFrameEvents(wfeCookie);
                dteEvents.ModeChanged -= DteEvents_ModeChanged;
            }
        }
コード例 #3
0
 private void UnadviseWindowFrameEvents()
 {
     _services.MainThread().Assert();
     _uiShell.UnadviseWindowFrameEvents(_cookie);
     _cookie = 0;
 }
コード例 #4
0
 public void Unadvise()
 {
     Shell.ThreadHelper.ThrowIfNotOnUIThread();
     IVsUIShell7 uiShell = (IVsUIShell7)Package.GetGlobalService(typeof(SVsUIShell));
     uiShell.UnadviseWindowFrameEvents(_cookie);
 }
コード例 #5
0
 private void UnadviseWindowFrameEvents()
 {
     _coreShell.AssertIsOnMainThread();
     _uiShell.UnadviseWindowFrameEvents(_cookie);
     _cookie = 0;
 }