public ConnectionDialog()
 {
     Telemetry.TrackPageView(nameof(ConnectionDialog));
     _loading = true;
     InitializeComponent();
     Background           = VSThemes.GetWindowBackground();
     SaveButton.IsEnabled = false;
     TestButton.IsEnabled = false;
     _loading             = false;
 }
示例#2
0
        public void ChangeTheme(VSThemes vsTheme)
        {
            // Our pointer to the list items never changes but only gets swapped.
            // So let's re-point the current theme object to the new list item
            // and invoke a win32 message to all child windows of Visual Studio.
            //
            // This is a very efficient and extremely fast way of communicating
            // without the need to manage event delegates.
            VSTheme currentTheme = CurrentTheme;

            CurrentTheme = this._themeCollection.First(theme => theme.VSThemeType == vsTheme);
            Win32ProcessMessageInvoker.SendSimpleMessage((UInt32)Win32ProjectHeroMessages.WM_ACEMSG_THEME_CHANGED, IntPtr.Zero, IntPtr.Zero);
        }
示例#3
0
        public VSTheme(string themeName, VSThemes vsThemeType, Color backgroundColor, Color foregroundColor,
                       string fontFamilyName, string themeGuid = "", float fontSize = 12.0f)
        {
            this.ThemeName             = themeName;
            this.VSThemeType           = vsThemeType;
            this._backgroundBrushColor = backgroundColor;
            this._foregroundBrushColor = foregroundColor;
            this.FontFamilyName        = fontFamilyName;
            this._fontSize             = fontSize;
            this.ThemeGuid             = themeGuid;

            // Initialize all resources now.
            this.OptimalFont      = new Font(fontFamilyName, fontSize, FontStyle.Regular, GraphicsUnit.Pixel);
            this._backgroundBrush = new SolidBrush(this._backgroundBrushColor);
            this._foregroundBrush = new SolidBrush(this._foregroundBrushColor);
        }