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)); }
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; } }
private void UnadviseWindowFrameEvents() { _services.MainThread().Assert(); _uiShell.UnadviseWindowFrameEvents(_cookie); _cookie = 0; }
public void Unadvise() { Shell.ThreadHelper.ThrowIfNotOnUIThread(); IVsUIShell7 uiShell = (IVsUIShell7)Package.GetGlobalService(typeof(SVsUIShell)); uiShell.UnadviseWindowFrameEvents(_cookie); }
private void UnadviseWindowFrameEvents() { _coreShell.AssertIsOnMainThread(); _uiShell.UnadviseWindowFrameEvents(_cookie); _cookie = 0; }