コード例 #1
0
        /// <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;
                }
            }
        }
コード例 #2
0
ファイル: RecentChangesPage.cs プロジェクト: windygu/AnkhSVN
        private void HookHandlers()
        {
            AnkhServiceEvents ev = Context.GetService <AnkhServiceEvents>();

            if (ev != null)
            {
                ev.SolutionClosed += new EventHandler(OnSolutionClosed);
                ev.SolutionOpened += new EventHandler(OnSolutionOpened);
            }
        }
コード例 #3
0
        protected override void OnInitialize()
        {
            base.OnInitialize();

            IsActive = true;

            AnkhServiceEvents events = GetService <AnkhServiceEvents>();

            events.SolutionOpened += new EventHandler(OnSolutionOpened);
            events.SolutionClosed += new EventHandler(OnSolutionClosed);

            _solutionOpen = !string.IsNullOrEmpty(GetService <ISelectionContext>().SolutionFilename);
        }
コード例 #4
0
        protected override void OnCreate()
        {
            _host.Load();
            //Control.Site = _host;
            Control.ToolWindowHost = _host;
            base.OnCreate();

            _serviceEvents = _host.GetService <AnkhServiceEvents>();
            if (_serviceEvents != null)
            {
                _serviceEvents.ThemeChanged += OnThemeChanged;
            }
        }
コード例 #5
0
        protected override void OnInitialize()
        {
            base.OnInitialize();

            if (_hookImageList)
            {
                AnkhServiceEvents ev = GetService<AnkhServiceEvents>();

                ev.SccProviderActivated += OnSccProviderActivated;
                ev.SccProviderDeactivated += OnSccProviderDeactivated;
                ev.SolutionClosed += OnSolutionClosed;
                ev.SolutionOpened += OnSolutionOpened;
            }
        }
コード例 #6
0
ファイル: ProjectTracker.cs プロジェクト: pangfd/AnkhSVN2019
        protected override void OnInitialize()
        {
            base.OnInitialize();

            AnkhServiceEvents ev = GetService <AnkhServiceEvents>();

            ev.SccProviderActivated   += OnSvnSccProviderActivated;
            ev.SccProviderDeactivated += OnSccProviderDeactivated;

            IAnkhCommandStates states = GetService <IAnkhCommandStates>();

            // Github issue #18.
            // Initialse SVN support unconditionally.
            // There is only one SCC provider in this package. The experimental GIT support has been removed.
            OnSvnSccProviderActivated(this, EventArgs.Empty);
        }
コード例 #7
0
        protected override void OnInitialize()
        {
            base.OnInitialize();
            AnkhServiceEvents events = GetService <AnkhServiceEvents>();

            if (events != null)
            {
                // register solution event handlers
                events.SolutionOpened += new EventHandler(OnSolutionOpened);
                events.SolutionClosed += new EventHandler(OnSolutionClosed);
            }

            if (Manager != null)
            {
                Manager.PendingChanges.CollectionChanged += OnPendingChangesCollectionChanged;
                Manager.PendingChanges.ItemChanged       += OnPendingChangeChanged;
            }
        }
コード例 #8
0
        protected override void OnLoad(EventArgs e)
        {
            foreach (PendingChangesPage p in _pages)
            {
                p.Context     = Context;
                p.ToolControl = this;

                if (!contentPanel.Controls.Contains(p))
                {
                    p.Enabled = p.Visible = false;
                    p.Dock    = DockStyle.Fill;
                    contentPanel.Controls.Add(p);
                }
            }

            base.OnLoad(e);

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

            ev.SccProviderActivated   += new EventHandler(OnSccProviderActivated);
            ev.SccProviderDeactivated += new EventHandler(OnSccProviderDeactivated);

            IAnkhCommandStates states = Context.GetService <IAnkhCommandStates>();

            bool shouldActivate = false;

            if (states != null)
            {
                if (!states.UIShellAvailable)
                {
                    ev.UIShellActivate += new EventHandler(OnSccShellActivate);
                    shouldActivate      = false;
                }
                else
                {
                    shouldActivate = states.SccProviderActive;
                }
            }

            _lastPage = _commitsPage;

            ShowPanel(shouldActivate ? _lastPage : _activatePage, false);
            pendingChangesTabs.Enabled = shouldActivate;
        }
コード例 #9
0
        private void HookList()
        {
            if (_manager != null || Context == null)
            {
                return;
            }

            _manager = Context.GetService <IPendingChangesManager>();

            if (_manager == null)
            {
                return;
            }

            UI.Items = _manager.PendingChanges;

            if (pendingCommits != null)
            {
                if (pendingCommits.SmallImageList == null)
                {
                    IFileIconMapper mapper = Context.GetService <IFileIconMapper>();

                    pendingCommits.SmallImageList = mapper.ImageList;
                }

                _manager.IsActiveChanged    += OnPendingChangesActiveChanged;
                _manager.BatchUpdateStarted += new EventHandler <BatchStartedEventArgs>(OnBatchUpdateStarted);
            }

            _manager.PendingChanges.ItemChanged += OnPendingChangesChanged;

            if (!_manager.IsActive)
            {
                _manager.IsActive = true;
                _manager.FullRefresh(false);
            }

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

            ev.SolutionClosed += new EventHandler(OnSolutionRefresh);
            ev.SolutionOpened += new EventHandler(OnSolutionRefresh);
            OnSolutionRefresh(this, EventArgs.Empty);
        }
コード例 #10
0
        protected override void OnInitialize()
        {
            base.OnInitialize();

            AnkhServiceEvents ev = GetService <AnkhServiceEvents>();

            ev.SccProviderActivated      += OnSvnSccProviderActivated;
            ev.SccProviderDeactivated    += OnSccProviderDeactivated;
            ev.GitSccProviderActivated   += OnGitSccProviderActivated;
            ev.GitSccProviderDeactivated += OnSccProviderDeactivated;

            IAnkhCommandStates states = GetService <IAnkhCommandStates>();

            if (states != null && states.SccProviderActive)
            {
                OnSvnSccProviderActivated(this, EventArgs.Empty);
            }
            else if (states != null && states.GitSccProviderActive)
            {
                OnGitSccProviderActivated(this, EventArgs.Empty);
            }
        }