/// <summary> /// Loads the theme from the file resource specified and registers it into ThemeResolutionService. Thais method is called /// immediately when correct ThemeLocation and StorageType are specified. /// </summary> public virtual void ReloadThemeFromStorage() { //check for file load redundancy, only if it's not in Designmode bool checkFileLoadRedundancy = this.OwnerThemeManager == null || !this.OwnerThemeManager.IsDesignMode; if (callingAssembly == null) { callingAssembly = Assembly.GetCallingAssembly(); } if (checkFileLoadRedundancy) { if (locationsAlreadyLoaded[this.callingAssembly.FullName + this.ThemeLocation] == locationLoadedMarker) { return; } } XmlTheme theme = new XmlTheme(); theme.LoadPartiallyFromStorage(this); Theme.Deserialize(theme); if (checkFileLoadRedundancy && this.loadSucceeded) { locationsAlreadyLoaded[this.callingAssembly.FullName + this.ThemeLocation] = locationLoadedMarker; } }
public XmlTheme GetXmlThemeObject() { if (callingAssembly == null) { callingAssembly = Assembly.GetCallingAssembly(); } XmlTheme theme = new XmlTheme(); theme.LoadPartiallyFromStorage(this); Theme.Deserialize(theme); return(theme); }