SaveToXmlFile() public static méthode

public static SaveToXmlFile ( List themes, string filename ) : void
themes List
filename string
Résultat void
Exemple #1
0
        /// <summary>
        /// Add a new theme based on an existing one by cloning and renaming, the theme is saved to disk
        /// </summary>
        /// <param name="baseTheme"></param>
        /// <param name="newThemeName"></param>
        /// <returns></returns>
        public ThemeInfo addTheme(ThemeInfo baseTheme, string newThemeName)
        {
            if (themes.Contains(newThemeName))
            {
                return(null);
            }
            var modifiedTheme = (ThemeInfo)baseTheme.Clone();

            modifiedTheme.Name         = newThemeName;
            modifiedTheme.IsExtendable = true;
            modifiedTheme.IsThemeBase  = false;
            ThemeSerializer.SaveToXmlFile(modifiedTheme, baseTheme);
            themes.Add(newThemeName, modifiedTheme);
            return(modifiedTheme);
        }
Exemple #2
0
 public static void SaveThemes(List <ThemeInfo> themes)
 {
     themes.Remove(DefaultTheme);
     ThemeSerializer.SaveToXmlFile(themes, Path.Combine(App.Info.SettingsFileInfo.SettingsPath, App.Info.SettingsFileInfo.ThemesFileName));
 }