public IVsWindowFrame FindSolutionExplorerFrame(IVsUIShell uiShell) { if (SolutionExplorer == null) { //IVsUIShell shell = GetService<IVsUIShell>(typeof(SVsUIShell)); //IVsUIShell uiShell = (IVsUIShell)cmp.GetService(typeof(SVsUIShell)); Debug.Assert(uiShell != null); // Must be true if (uiShell != null) { IVsWindowFrame solutionExplorer; Guid solutionExplorerGuid = new Guid(ToolWindowGuids80.SolutionExplorer); Marshal.ThrowExceptionForHR(uiShell.FindToolWindow((uint)__VSFINDTOOLWIN.FTW_fForceCreate, ref solutionExplorerGuid, out solutionExplorer)); if (solutionExplorer != null) { SolutionExplorer = solutionExplorer; IVsWindowFrame2 solutionExplorer2 = solutionExplorer as IVsWindowFrame2; if (solutionExplorer2 != null) { uint cookie; Marshal.ThrowExceptionForHR(solutionExplorer2.Advise(this, out cookie)); Cookie = cookie; SolutionExplorer2 = solutionExplorer2; } } } } return(SolutionExplorer); }
public WindowFrameEvents(IVsWindowFrame2 frame) { ThreadHelper.ThrowIfNotOnUIThread(); this.frame = frame; ErrorHandler.ThrowOnFailure(frame.Advise(this, out this.cookie)); }
void IVSEditorControlInit.InitializedForm(Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy hier, uint id, IVsWindowFrame frame, IAnkhEditorPane pane) { ThreadHelper.ThrowIfNotOnUIThread(); _frame = frame; _pane = pane; if (_targets != null && pane != null) { foreach (IOleCommandTarget t in _targets) { _pane.AddCommandTarget(t); } } IVsWindowFrame2 frame2 = _frame as IVsWindowFrame2; if (frame2 != null) { if (frame2.Advise(this, out _frameNotifyCookie) != 0) { _frameNotifyCookie = 0; } } OnFrameLoaded(EventArgs.Empty); }
public void Advise() { var hr = _frame.Advise(this, out _notifyCookie); if (ErrorHandler.Failed(hr)) { Logger.LogWarn("IVsWindowFrame2.Advise() failed: hr={0}", hr); } }
public DiffMergeInstance(IAnkhServiceProvider context, IVsWindowFrame frame) : base(context) { _frame = frame; _frame2 = frame as IVsWindowFrame2; if (_frame2 != null && VSErr.Succeeded(_frame2.Advise(this, out _frameCookie))) { _frameHooked = true; } }
private ToolWindowPane createBuildDetailsWindow() { IVsWindowFrame windowFrame; ToolWindowPane window = createDetailsWindow(typeof(BuildDetailsToolWindow), out windowFrame); BuildDetailsWindow.Instance.WindowFrame = window; IVsWindowFrame2 wf2 = (IVsWindowFrame2)windowFrame; uint cookie; wf2.Advise(BuildDetailsWindow.Instance, out cookie); return(window); }
private InteractiveWindowEvents(IVsWindowFrame2 frame, IVsInteractiveWindow window) { _frame = frame; _window = window; ErrorHandler.ThrowOnFailure(frame.Advise(this, out _cookie)); }