private static void UserPreferenceChanging(object obj, UserPreferenceChangingEventArgs e)
 {
     highContrastSettingValid = false;
     lowResSettingValid = false;
     terminalSettingValid = false;
     dropShadowSettingValid = false;
     bitsPerPixel = 0;
     if (e.Category == UserPreferenceCategory.General)
     {
         menuAccessKeysUnderlinedValid = false;
     }
 }
 /// <include file='doc\VisualStyleRenderer.uex' path='docs/doc[@for="VisualStyleRenderer.OnThemeChanged"]/*' />
 /// <devdoc>
 ///    <para>
 ///       Handles the ThemeChanged event. Basically, we need to ensure all per-thread theme handle
 ///       caches are refreshed.
 ///    </para>
 /// </devdoc>
 private static void OnUserPreferenceChanging(object sender, UserPreferenceChangingEventArgs ea) {
     if (ea.Category == UserPreferenceCategory.VisualStyle) {
         // Let all threads know their cached handles are no longer valid; 
         // cache refresh will happen at next handle access.
         // Note that if the theme changes 2^sizeof(long) times before a thread uses 
         // its handle, this whole version hack won't work, but I don't see that happening.
         globalCacheVersion++; 
     }
 }
 private static void OnUserPreferenceChanging(object sender, UserPreferenceChangingEventArgs ea)
 {
     if (ea.Category == UserPreferenceCategory.VisualStyle)
     {
         globalCacheVersion += 1L;
     }
 }
Exemplo n.º 4
0
 private static void OnUserPreferenceChanging(object sender, UserPreferenceChangingEventArgs e) {
     if (e.Category == UserPreferenceCategory.Color && colorTable != null) {
         UpdateSystemColors(colorTable);
     }
 }
Exemplo n.º 5
0
 static void SystemEvents_UserPreferenceChanging(object sender, UserPreferenceChangingEventArgs e)
 {
 }
 private static void OnUserPreferenceChanging(object sender, UserPreferenceChangingEventArgs e)
 {
     if (e.Category == UserPreferenceCategory.Window)
     {
         lock (internalSyncObject)
         {
             defaultFont = null;
         }
     }
 }
Exemplo n.º 7
0
		private void UserPreferenceChangingCallback (object o, UserPreferenceChangingEventArgs args)
		{
		}
Exemplo n.º 8
0
        private static void OnUserPreferenceChanging(object sender, UserPreferenceChangingEventArgs e) {
            // using changing here so that the cache will be cleared by the time the ToolStrip
            // hooks onto the changed event.

            // SPI_SETNONCLIENTMETRICS is put up in WM_SETTINGCHANGE if the Menu font changes.
            // this corresponds to UserPreferenceCategory.Window.
            if (e.Category == UserPreferenceCategory.Window) {
                lock (internalSyncObject) {
                    defaultFont = null;
                }
            }
        }
        /// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// userpreferencechangingeventhandler.BeginInvoke(sender, e, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this UserPreferenceChangingEventHandler userpreferencechangingeventhandler, Object sender, UserPreferenceChangingEventArgs e, AsyncCallback callback)
        {
            if(userpreferencechangingeventhandler == null) throw new ArgumentNullException("userpreferencechangingeventhandler");

            return userpreferencechangingeventhandler.BeginInvoke(sender, e, callback, null);
        }
		public void Deny_Unrestricted ()
		{
			UserPreferenceChangingEventArgs upcea = new UserPreferenceChangingEventArgs (UserPreferenceCategory.Color);
			Assert.AreEqual (UserPreferenceCategory.Color, upcea.Category, "Category");
		}