Type GetPaneType(VisualHGToolWindow toolWindow) { switch (toolWindow) { case VisualHGToolWindow.PendingChanges: return(typeof(HGPendingChangesToolWindow)); default: throw new ArgumentOutOfRangeException("toolWindow"); } }
public void ShowToolWindow(VisualHGToolWindow toolWindow, int id, bool create) { try { ToolWindowPane pane = FindToolWindow(GetPaneType(toolWindow), id, create); IVsWindowFrame frame = pane.Frame as IVsWindowFrame; if (frame == null) { throw new InvalidOperationException("FindToolWindow failed"); } // Bring the tool window to the front and give it focus Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(frame.Show()); } catch (Exception e) { MessageBox.Show(e.Message, "Error occured"); } }
public ToolWindowPane FindToolWindow(VisualHGToolWindow toolWindow) { ToolWindowPane pane = FindToolWindow(GetPaneType(toolWindow), 0, false); return(pane); }
//public ToolWindowPane FindToolWindow(Type toolWindowType, int id, bool create); public void ShowToolWindow(VisualHGToolWindow window) { ShowToolWindow(window, 0, true); }