// Token: 0x0600638E RID: 25486 RVA: 0x001C0444 File Offset: 0x001BE644
        private static UxThemeWrapper.ThemeState EnsureThemeState(bool themeChanged)
        {
            UxThemeWrapper.ThemeState themeState = UxThemeWrapper._themeState;
            bool flag  = !themeChanged;
            bool flag2 = true;

            while (flag2)
            {
                UxThemeWrapper.ThemeState themeState2;
                if (themeChanged)
                {
                    bool   flag3 = !SystemParameters.HighContrast && SafeNativeMethods.IsUxThemeActive();
                    string name;
                    string color;
                    if (flag3 && (flag || themeState.ThemeName != null))
                    {
                        UxThemeWrapper.GetThemeNameAndColor(out name, out color);
                    }
                    else
                    {
                        color = (name = null);
                    }
                    themeState2 = new UxThemeWrapper.ThemeState(flag3, name, color);
                }
                else if (themeState.IsActive && themeState.ThemeName == null)
                {
                    string name;
                    string color;
                    UxThemeWrapper.GetThemeNameAndColor(out name, out color);
                    themeState2 = new UxThemeWrapper.ThemeState(themeState.IsActive, name, color);
                }
                else
                {
                    themeState2 = themeState;
                    flag2       = false;
                }
                if (flag2)
                {
                    UxThemeWrapper.ThemeState themeState3 = Interlocked.CompareExchange <UxThemeWrapper.ThemeState>(ref UxThemeWrapper._themeState, themeState2, themeState);
                    if (themeState3 == themeState)
                    {
                        themeState = themeState2;
                        flag2      = false;
                    }
                    else if (themeState3.IsActive == themeState2.IsActive && (!themeState2.IsActive || themeState2.ThemeName == null || themeState3.ThemeName != null))
                    {
                        themeState = themeState3;
                        flag2      = false;
                    }
                    else
                    {
                        themeChanged = true;
                        themeState   = themeState3;
                    }
                }
            }
            return(themeState);
        }
 // Token: 0x06006390 RID: 25488 RVA: 0x001C05B1 File Offset: 0x001BE7B1
 internal static void OnThemeChanged()
 {
     UxThemeWrapper.RestoreSupportedState();
     UxThemeWrapper.EnsureThemeState(true);
 }