/// <summary>
        /// Called when the frame is created
        /// </summary>
        /// <param name="e"></param>
        protected override void OnFrameCreated(EventArgs e)
        {
            base.OnFrameCreated(e);

            ToolWindowHost.CommandContext  = AnkhId.SccExplorerContextGuid;
            ToolWindowHost.KeyboardContext = AnkhId.SccExplorerContextGuid;

            folderTree.Context = Context;
            fileList.Context   = Context;

            VSCommandHandler.Install(Context, this, AnkhCommand.ExplorerUp, OnUp, OnUpdateUp);
            VSCommandHandler.Install(Context, this, AnkhCommand.Refresh, OnRefresh, OnUpdateRefresh);
            VSCommandHandler.Install(Context, this, new CommandID(VSConstants.GUID_VSStandardCommandSet97, (int)VSConstants.VSStd97CmdID.Open), OnOpen, OnUpdateOpen);
            VSCommandHandler.Install(Context, this, new CommandID(VSConstants.GUID_VSStandardCommandSet97, (int)VSConstants.VSStd97CmdID.Delete), OnDelete, OnUpdateDelete);
            VSCommandHandler.Install(Context, this, new CommandID(VSConstants.GUID_VSStandardCommandSet97, (int)VSConstants.VSStd97CmdID.Rename), OnRename, OnUpdateRename);

            AnkhServiceEvents environment = Context.GetService <AnkhServiceEvents>();

            // The Workingcopy explorer is a singleton toolwindow (Will never be destroyed unless VS closes)
            environment.SolutionClosed += OnSolutionClosed;
            environment.SolutionOpened += OnSolutionOpened;

            IUIService ui = Context.GetService <IUIService>();

            if (ui != null)
            {
                ToolStripRenderer renderer = ui.Styles["VsToolWindowRenderer"] as ToolStripRenderer;

                if (renderer != null)
                {
                    foldersStrip.Renderer = renderer;
                }
            }
        }
Ejemplo n.º 2
0
        public void HookCommands()
        {
            if (_hooked)
            {
                return;
            }

            if (Context != null)
            {
                _hooked = true;
                VSCommandHandler.Install(Context, this,
                                         new CommandID(VSConstants.GUID_VSStandardCommandSet97, (int)VSConstants.VSStd97CmdID.SelectAll),
                                         OnSelectAll);
            }
        }
Ejemplo n.º 3
0
        private void OnContextChanged()
        {
            SelectionPublishServiceProvider = Context;

            if (Context != null && !_installed)
            {
                _installed = true;

                try
                {
                    VSCommandHandler.Install(Context, this, new CommandID(VSConstants.GUID_VSStandardCommandSet97, (int)VSConstants.VSStd97CmdID.Copy), OnCopy, OnUpdateCopy);
                }
                catch (InvalidOperationException)
                {
                    // ### Dialog is not ready yet :(
                }
            }
        }
Ejemplo n.º 4
0
        protected override void OnLoad(EventArgs e)
        {
            InsertPendingChanges();

            base.OnLoad(e);

            if (pendingCommits != null)
            {
                pendingCommits.AllowColumnReorder = true;
                pendingCommits.CheckBoxes         = true;
                pendingCommits.HideSelection      = false;
                pendingCommits.Name                  = "pendingCommits";
                pendingCommits.ShowItemToolTips      = true;
                pendingCommits.ShowSelectAllCheckBox = true;
                pendingCommits.KeyUp                += new System.Windows.Forms.KeyEventHandler(this.pendingCommits_KeyUp);

                pendingCommits.SelectionPublishServiceProvider = Context;
                pendingCommits.Context = Context;
                pendingCommits.OpenPendingChangeOnDoubleClick = true;
                pendingCommits.HookCommands();
                pendingCommits.ColumnWidthChanged += new ColumnWidthChangedEventHandler(pendingCommits_ColumnWidthChanged);
                IDictionary <string, int> widths = ConfigurationService.GetColumnWidths(GetType());
                pendingCommits.SetColumnWidths(widths);

                logMessageEditor.PendingChangeUI = this.pendingCommits;
            }
            else
            {
                logMessageEditor.PendingChangeUI = this.pendingChangeControl.UI;
            }

            Context.GetService <AnkhServiceEvents>().LastChanged += OnLastChanged;

            VSCommandHandler.Install(Context, this, new CommandID(VSConstants.VSStd2K, 1635 /* cmdidExploreFolderInWindows */), OnOpenFolder, OnUpdateOpenFolder);

            HookList();
        }
Ejemplo n.º 5
0
        protected override void OnFrameCreated(EventArgs e)
        {
            base.OnFrameCreated(e);

            ToolWindowHost.CommandContext  = AnkhId.SccExplorerContextGuid;
            ToolWindowHost.KeyboardContext = AnkhId.SccExplorerContextGuid;

            VSCommandHandler.Install(Context, this, new CommandID(VSConstants.GUID_VSStandardCommandSet97, (int)VSConstants.VSStd97CmdID.Delete), OnDelete, OnUpdateDelete);
            VSCommandHandler.Install(Context, this, new CommandID(VSConstants.GUID_VSStandardCommandSet97, (int)VSConstants.VSStd97CmdID.Rename), OnRename, OnUpdateRename);
            VSCommandHandler.Install(Context, this, new CommandID(VSConstants.GUID_VSStandardCommandSet97, (int)VSConstants.VSStd97CmdID.Open), OnOpen, OnUpdateOpen);
            VSCommandHandler.Install(Context, this, AnkhCommand.ExplorerUp, OnUp, OnUpdateUp);

            IUIService ui = Context.GetService <IUIService>();

            if (ui != null)
            {
                ToolStripRenderer renderer = ui.Styles["VsToolWindowRenderer"] as ToolStripRenderer;

                if (renderer != null)
                {
                    toolFolders.Renderer = renderer;
                }
            }
        }