예제 #1
0
        Type GetPaneType(VisualHGToolWindow toolWindow)
        {
            switch (toolWindow)
            {
            case VisualHGToolWindow.PendingChanges:
                return(typeof(HGPendingChangesToolWindow));

            default:
                throw new ArgumentOutOfRangeException("toolWindow");
            }
        }
예제 #2
0
        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");
            }
        }
예제 #3
0
        public ToolWindowPane FindToolWindow(VisualHGToolWindow toolWindow)
        {
            ToolWindowPane pane = FindToolWindow(GetPaneType(toolWindow), 0, false);

            return(pane);
        }
예제 #4
0
 //public ToolWindowPane FindToolWindow(Type toolWindowType, int id, bool create);
 public void ShowToolWindow(VisualHGToolWindow window)
 {
     ShowToolWindow(window, 0, true);
 }