// Token: 0x06000C34 RID: 3124 RVA: 0x0002D758 File Offset: 0x0002B958 private static void Register(ResourceDictionary dictionary, string assemblyName) { if (ThemeDictionaryExtension._themeDictionaryInfos == null) { ThemeDictionaryExtension._themeDictionaryInfos = new List <ThemeDictionaryExtension.ThemeDictionaryInfo>(); } ThemeDictionaryExtension.ThemeDictionaryInfo themeDictionaryInfo; for (int i = 0; i < ThemeDictionaryExtension._themeDictionaryInfos.Count; i++) { themeDictionaryInfo = ThemeDictionaryExtension._themeDictionaryInfos[i]; if (!themeDictionaryInfo.DictionaryReference.IsAlive) { ThemeDictionaryExtension._themeDictionaryInfos.RemoveAt(i); i--; } else if (themeDictionaryInfo.DictionaryReference.Target == dictionary) { themeDictionaryInfo.AssemblyName = assemblyName; return; } } themeDictionaryInfo = new ThemeDictionaryExtension.ThemeDictionaryInfo(); themeDictionaryInfo.DictionaryReference = new WeakReference(dictionary); themeDictionaryInfo.AssemblyName = assemblyName; ThemeDictionaryExtension._themeDictionaryInfos.Add(themeDictionaryInfo); }
// Token: 0x06000C35 RID: 3125 RVA: 0x0002D7F0 File Offset: 0x0002B9F0 internal static void OnThemeChanged() { if (ThemeDictionaryExtension._themeDictionaryInfos != null) { for (int i = 0; i < ThemeDictionaryExtension._themeDictionaryInfos.Count; i++) { ThemeDictionaryExtension.ThemeDictionaryInfo themeDictionaryInfo = ThemeDictionaryExtension._themeDictionaryInfos[i]; if (!themeDictionaryInfo.DictionaryReference.IsAlive) { ThemeDictionaryExtension._themeDictionaryInfos.RemoveAt(i); i--; } else { ResourceDictionary resourceDictionary = (ResourceDictionary)themeDictionaryInfo.DictionaryReference.Target; resourceDictionary.Source = ThemeDictionaryExtension.GenerateUri(themeDictionaryInfo.AssemblyName, SystemResources.ResourceDictionaries.ThemedResourceName, UxThemeWrapper.ThemeName); } } } }
// Token: 0x06000C32 RID: 3122 RVA: 0x0002D6A8 File Offset: 0x0002B8A8 internal static Uri GenerateFallbackUri(ResourceDictionary dictionary, string resourceName) { for (int i = 0; i < ThemeDictionaryExtension._themeDictionaryInfos.Count; i++) { ThemeDictionaryExtension.ThemeDictionaryInfo themeDictionaryInfo = ThemeDictionaryExtension._themeDictionaryInfos[i]; if (!themeDictionaryInfo.DictionaryReference.IsAlive) { ThemeDictionaryExtension._themeDictionaryInfos.RemoveAt(i); i--; } else if ((ResourceDictionary)themeDictionaryInfo.DictionaryReference.Target == dictionary) { string themeName = resourceName.Split(new char[] { '/' })[1]; return(ThemeDictionaryExtension.GenerateUri(themeDictionaryInfo.AssemblyName, resourceName, themeName)); } } return(null); }