private void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
 {
     if (((sender != null) && (e != null)) && (e.Category == UserPreferenceCategory.Accessibility))
     {
         this.OnPropertyChanged("HighContrast");
     }
 }
 private static void SystemEvents_UserPreferenceChanged(object sender, Microsoft.Win32.UserPreferenceChangedEventArgs e)
 {
     if (e.Category == Microsoft.Win32.UserPreferenceCategory.Color)
     {
         Skybound.VisualTips.Rendering.VisualTipOfficePreset.UpdateAutoSelect();
     }
 }
Example #3
0
 private void SystemEvents_UserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
 {
     if (e.Category == UserPreferenceCategory.Window)
     {
         this.Font = SystemFonts.IconTitleFont;
     }
 }
Example #4
0
 void SystemEvents_UserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
 {
     if (e.Category == UserPreferenceCategory.Color)
     {
         this.OnSystemColorsChanged();
     }
 }
 void SystemEvents_UserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
 {
     // High contrast setting change is part of the Accessibility category.
     if (e.Category == UserPreferenceCategory.Accessibility)
     {
         OnAccessibilityUserPreferencesChanged();
     }
 }
 private static void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
 {
     SetScheme();
     if (e.Category == UserPreferenceCategory.Color)
     {
         colorFreshnessKey = new object();
     }
 }
Example #7
0
 private static void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
 {
     if ((e.Category == UserPreferenceCategory.Color) && (menuBarBrush != null))
     {
         menuBarBrush.Dispose();
         menuBarBrush = null;
     }
 }
Example #8
0
 private void OnUserPreferenceChanged(object sender, Microsoft.Win32.UserPreferenceChangedEventArgs e)
 {
     // If the colors have been changed
     if (e.Category == UserPreferenceCategory.Color)
     {
         // Use as a signal to retest the theme information
         _themeTested = false;
     }
 }
Example #9
0
 private static void SystemEvents_UserPreferenceChanged(object sender, Microsoft.Win32.UserPreferenceChangedEventArgs e)
 {
     if (e.Category != UserPreferenceCategory.Desktop)
     {
         return;
     }
     if (DisplayChanged != null)
     {
         DisplayChanged(null, EventArgs.Empty);
     }
 }
 private static void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
 {
     // Update fonts to reflect any change in system settings
     DefineFonts();
 }
Example #11
0
        protected void OnPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
        {
            // Are we using the default menu or a user defined value?
            if (_defaultFont)
            {
                DefineFont(SystemInformation.MenuFont);

                Recalculate();
                Invalidate();
            }
        }
Example #12
0
 private void UserPreferenceChanged(object sender, UserPreferenceChangedEventArgs pref) {
     if (pref.Category == UserPreferenceCategory.Locale) {
        // We need to recreate the monthcalendar handle when the locale changes, because
         // the day names etc. are only updated on a handle recreate (comctl32 limitation).
         //
         RecreateHandle();
     }
 }
Example #13
0
 private void MarshaledUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs pref) {
     try {
         //use begininvoke instead of invoke in case the destination thread is not processing messages.
         BeginInvoke(new UserPreferenceChangedEventHandler(this.UserPreferenceChanged), new object[] { sender, pref });
     }
     catch (InvalidOperationException) { } //if the destination thread does not exist, don't send.
 }
        /// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// userpreferencechangedeventhandler.BeginInvoke(sender, e, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this UserPreferenceChangedEventHandler userpreferencechangedeventhandler, Object sender, UserPreferenceChangedEventArgs e, AsyncCallback callback)
        {
            if(userpreferencechangedeventhandler == null) throw new ArgumentNullException("userpreferencechangedeventhandler");

            return userpreferencechangedeventhandler.BeginInvoke(sender, e, callback, null);
        }
Example #15
0
 private void OnSysColorChange(object sender, UserPreferenceChangedEventArgs e) {
     if (e.Category == UserPreferenceCategory.Color || e.Category == UserPreferenceCategory.Accessibility) {
         SetFlag(FlagNeedUpdateUIBasedOnFont, true);
     }
 }
Example #16
0
 private static void SystemEvents_UserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
 {
     SetColors();
 }
Example #17
0
 private void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
 {
     if (e.Category == UserPreferenceCategory.Desktop)
     {
         OnDisplaySettingsChanged(sender, e);
     }
 }
 protected void OnPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
 {
     try
     {
         // Are we using the default menu or a user defined value?
         if (_defaultFont)
         {
             base.Font = SystemInformation.MenuFont;
             ResizeControl();
             Recalculate();
             Invalidate();
         }
     }
     catch(System.Exception ex)
     {MessageBox.Show(ex.Message);}
 }
 private static void UserPreferenceChanged(object obj, UserPreferenceChangedEventArgs ea)
 {
     highContrastSettingValid = false;
     lowResSettingValid = false;
     terminalSettingValid = false;
     dropShadowSettingValid = false;
     bitsPerPixel = 0;
 }
 private void OnUserPreferenceChanged(Object sender, UserPreferenceChangedEventArgs e)
 {
     if (e.Category == UserPreferenceCategory.Color)
     {
         bool infoMode;
         String newMessage = GetErrorMessage(out infoMode);
         OnBackgroundImageChange(newMessage, infoMode);
     }            
 }
        private void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
        {
            if (e.Category == UserPreferenceCategory.Color)
            {
                SystemEvents.UserPreferenceChanged -= OnUserPreferenceChanged;

                // recreate button image, required to support high contrast
                var editStyle = UITypeEditorEditStyle.DropDown;

                if (_uiTypeEditor != null)
                {
                    editStyle = _uiTypeEditor.GetEditStyle();
                }

                var oldImage = _button.Image;

                if (oldImage != null)
                {
                    try
                    {
                        if (editStyle == UITypeEditorEditStyle.DropDown)
                        {
                            _button.Image = CreateArrowBitmap();
                        }
                        else if (editStyle == UITypeEditorEditStyle.Modal)
                        {
                            _button.Image = CreateDotDotDotBitmap();
                        }
                    }
                    finally
                    {
                        oldImage.Dispose();
                    }
                }
            }
        }
 private void UserPreferenceChanged(object sender, UserPreferenceChangedEventArgs pref)
 {
     if (pref.Category == UserPreferenceCategory.Locale)
     {
         this.UpdateEditText();
     }
 }
 private void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
 {
     if (e.Category == UserPreferenceCategory.Color ||
         e.Category == UserPreferenceCategory.Locale ||
         e.Category == UserPreferenceCategory.General ||
         e.Category == UserPreferenceCategory.Window ||
         e.Category == UserPreferenceCategory.VisualStyle)
     {
         OnGlobalAutoSize();
         if (e.Category == UserPreferenceCategory.Window)
         {
             this.cachedEditingControl = null;
             if (this.editingControl != null)
             {
                 // The editing control may not adapt well to the new system rendering,
                 // so instead of caching it into the this.cachedEditingControl variable
                 // next time editing mode is exited, simply discard the control.
                 this.dataGridViewState2[DATAGRIDVIEWSTATE2_discardEditingControl] = true;
             }
             PerformLayoutPrivate(false /*useRowShortcut*/, false /*computeVisibleRows*/, false /*invalidInAdjustFillingColumns*/, true /*repositionEditingControl*/);
         }
     }
 }
 private static void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
 {
     if (e.Category == UserPreferenceCategory.Desktop)
     {
         Interlocked.Increment(ref desktopChangedCount);
     }
 }
Example #25
0
 /// <summary>
 /// Handler for UserPreferenceChangedEventArgs that updates the window display when the user modifies his or her desktop.
 /// Note: This does not detect taskbar changes when the taskbar is set to auto-hide.
 /// </summary>
 /// <param name="sender">The source of the event. When this event is raised by the SystemEvents class, this object is always null.</param>
 /// <param name="e">A UserPreferenceChangedEventArgs that contains the event data.</param>
 private void DesktopPreferenceChangedHandler(object sender, UserPreferenceChangedEventArgs e)
 {
     if (e.Category == UserPreferenceCategory.Desktop)
         this.UpdateWindowDisplayIfOpen(false);
 }
Example #26
0
 private void OnUserPreferenceChanged(object sender, Microsoft.Win32.UserPreferenceChangedEventArgs e)
 {
     // Use as a signal to retest the theme information
     _colorDetails.Reset();
 }
Example #27
0
 private void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
 {
     if (e.Category == UserPreferenceCategory.Color && !_customColors)
     {
         GetColorsFromSystem();
         _customColors = false;
     }
 }
Example #28
0
 /// <summary>
 /// Invoked when the user changes system preferences.
 /// </summary>
 /// <param name="sender">The sender of the event</param>
 /// <param name="e">The event data</param>
 private void SystemEvents_UserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
 {
     if (e.Category == UserPreferenceCategory.Locale)
     {
         CultureInfo.CurrentCulture.ClearCachedData();
         RefreshStrings();
     }
 }
Example #29
0
        protected void OnPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
        {
            if (_defaultBackColor)
            {
                _backColor = SystemColors.Control;
                PropogateNameValue(PropogateName.BackColor, (object)SystemColors.Control);
            }

            if (_defaultActiveColor)
            {
                _activeColor = SystemColors.ActiveCaption;
                PropogateNameValue(PropogateName.ActiveColor, (object)SystemColors.ActiveCaption);
            }

            if (_defaultActiveTextColor)
            {
                _activeTextColor = SystemColors.ActiveCaptionText;
                PropogateNameValue(PropogateName.ActiveTextColor, (object)SystemColors.ActiveCaptionText);
            }

            if (_defaultInactiveTextColor)
            {
                _inactiveTextColor = SystemColors.ControlText;
                PropogateNameValue(PropogateName.InactiveTextColor, (object)SystemColors.ControlText);
            }

            if (_defaultResizeBarColor)
            {
                _resizeBarColor = SystemColors.Control;
                PropogateNameValue(PropogateName.ResizeBarColor, (object)SystemColors.Control);
            }

            if (_defaultCaptionFont)
            {
                _captionFont = SystemInformation.MenuFont;
                PropogateNameValue(PropogateName.CaptionFont, (object)SystemInformation.MenuFont);
            }

            if (_defaultTabControlFont)
            {
                _tabControlFont = SystemInformation.MenuFont;
                PropogateNameValue(PropogateName.TabControlFont, (object)SystemInformation.MenuFont);
            }
        }
        private void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
        {
            if (e.Category == UserPreferenceCategory.Color)
            {
                SetColor();
            }

            SetFonts();
        }
Example #31
0
		void SystemEvents_UserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
		{
			// Reset the font (if required)
			SetFont();
		}
        /// <summary>
        /// Handle a change in the user preferences.
        /// </summary>
        /// <param name="sender">Source of event.</param>
        /// <param name="e">Event data.</param>
        protected override void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
        {
            // Remove the current table, so it gets regenerated when next requested
            _table = null;

            // Update fonts to reflect any change in system settings
            DefineFonts();

            base.OnUserPreferenceChanged(sender, e);
        }
        private void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
        {
            switch (e.Category)
            {
                case UserPreferenceCategory.General:
                    this.InvalidateTextItems();
                    break;

                case UserPreferenceCategory.Window:
                    this.OnDefaultFontChanged();
                    break;
            }
        }
Example #34
0
 private static void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs pref) {
     systemEventsDirty = true;
 }