Esempio n. 1
0
        public void RefreshPageContents()
        {
            Controls.Clear();

            if (IssueService != null)
            {
                IssueRepository repository = IssueService.CurrentIssueRepository;
                IWin32Window    window     = null;

                if (repository != null &&
                    (window = repository.Window) != null)
                {
                    Control control = Control.FromHandle(window.Handle);
                    if (control != null)
                    {
                        control.Dock = DockStyle.Fill;
                        Controls.Add(control);

                        if (VSVersion.SupportsTheming && Context != null)
                        {
                            IWinFormsThemingService wts = Context.GetService <IWinFormsThemingService>();

                            if (wts != null)
                            {
                                wts.ThemeRecursive(control, false);
                            }
                        }
                        return;
                    }
                }
            }
            Controls.Add(pleaseConfigureLabel);
        }
        private void ThemePage(PendingChangesPage page)
        {
            page._alreadyThemed = true;

            if (VSVersion.SupportsTheming && Context != null)
            {
                IWinFormsThemingService wts = Context.GetService <IWinFormsThemingService>();

                if (wts != null)
                {
                    wts.ThemeRecursive(page, false);
                }
            }
        }
Esempio n. 3
0
        protected virtual void ThemeDialog(EventArgs eventArgs)
        {
            if (!DesignMode && VSVersion.SupportsTheming)
            {
                IWinFormsThemingService themer = GetService <IWinFormsThemingService>();

                if (themer != null)
                {
                    if (!IsHandleCreated)
                    {
                        CreateHandle();
                    }
                    themer.ThemeRecursive(this, true);
                }
            }
        }
Esempio n. 4
0
        protected virtual void OnThemeChanged(EventArgs e)
        {
            if (Context == null)
            {
                return;
            }

            IWinFormsThemingService wfts = Context.GetService <IWinFormsThemingService>();

            if (wfts != null)
            {
                wfts.ThemeRecursive(this, false);
            }
            else
            {
                IAnkhVSColor colorSvc = Context.GetService <IAnkhVSColor>();

                if (colorSvc != null)
                {
                    Color color;
                    if (colorSvc.TryGetColor(__VSSYSCOLOREX.VSCOLOR_TOOLWINDOW_BACKGROUND, out color))
                    {
                        BackColor = color;
                    }

                    if (colorSvc.TryGetColor(__VSSYSCOLOREX.VSCOLOR_TOOLWINDOW_TEXT, out color))
                    {
                        ForeColor = color;
                    }
                }

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

                if (uis != null)
                {
                    Font f = (Font)uis.Styles["DialogFont"];

                    if (f != null)
                    {
                        this.Font = f;
                    }
                }
            }
        }