void ShowPanel(PendingChangesPage page, bool select)
        {
            if (page == null)
            {
                throw new ArgumentNullException("page");
            }
            else if (page == _currentPage)
            {
                return;
            }

            bool foundPage = false;

            foreach (PendingChangesPage p in contentPanel.Controls)
            {
                if (p != page)
                {
                    p.Enabled = p.Visible = false;
                }
                else
                {
                    foundPage = true;
                    p.Enabled = p.Visible = true;

                    if (!p._alreadyThemed)
                    {
                        ThemePage(p);
                    }
                }
            }

            System.Diagnostics.Debug.Assert(foundPage);

            _currentPage = page;

            if (page != _activatePage)
            {
                _lastPage = page;
            }

            fileChangesButton.Checked   = (_lastPage == _commitsPage);
            issuesButton.Checked        = (_lastPage == _issuesPage);
            recentChangesButton.Checked = (_lastPage == _changesPage);
            conflictsButton.Checked     = (_lastPage == _conflictsPage);

            if (select)
            {
                page.Select();
            }

            if (Context != null)
            {
                IAnkhCommandService cmd = Context.GetService <IAnkhCommandService>();

                if (cmd != null)
                {
                    cmd.UpdateCommandUI(false);
                }

                UpdateCaption();
            }
        }
Пример #2
0
        void ShowPanel(PendingChangesPage page, bool select)
        {
            if (page == null)
                throw new ArgumentNullException("page");
            else if (page == _currentPage)
                return;

            bool foundPage = false;
            foreach (PendingChangesPage p in panel1.Controls)
            {
                if (p != page)
                {
                    p.Enabled = p.Visible = false;
                }
                else
                {
                    foundPage = true;
                    p.Enabled = p.Visible = true;
                }
            }

            if (!foundPage)
            {
                panel1.Controls.Add(page);
                page.Dock = DockStyle.Fill;
            }

            _currentPage = page;

            if (page != _activatePage)
                _lastPage = page;

            fileChangesButton.Checked = (_lastPage == _commitsPage);
            issuesButton.Checked = (_lastPage == _issuesPage);
            recentChangesButton.Checked = (_lastPage == _changesPage);
            conflictsButton.Checked = (_lastPage == _conflictsPage);

            if (select)
                page.Select();

            if (Context != null)
            {
                IAnkhCommandService cmd = Context.GetService<IAnkhCommandService>();

                if (cmd != null)
                    cmd.UpdateCommandUI(false);

                UpdateCaption();
            }
        }