Ejemplo n.º 1
0
 public void Load()
 {
     ApplicationThemeManager.Instance.Refresh();
     Playlists    = PlaylistSettings.Load(Paths.BaseDirectory);
     Config       = ConfigSettings.Load(Paths.BaseDirectory);
     CurrentState = CurrentState.Load(Paths.BaseDirectory);
     IsLoaded     = true;
 }
Ejemplo n.º 2
0
        public static PlaylistSettings Load(string programpath)
        {
            var fi = new FileInfo(Path.Combine(programpath, Filename));
            if (!fi.Exists || string.IsNullOrWhiteSpace(File.ReadAllText(fi.FullName)))
            {
                var result = new PlaylistSettings();
                result.SetStandardValues();
                return result;
            }

            using (StreamReader reader = new StreamReader(fi.FullName))
            {
                var deserializer = new XmlSerializer(typeof(PlaylistSettings));
                return (PlaylistSettings)deserializer.Deserialize(reader);
            }
        }
Ejemplo n.º 3
0
        public static PlaylistSettings Load(string programpath)
        {
            var fi = new FileInfo(Path.Combine(programpath, Filename));

            if (!fi.Exists || string.IsNullOrWhiteSpace(File.ReadAllText(fi.FullName)))
            {
                var result = new PlaylistSettings();
                result.SetStandardValues();
                return(result);
            }

            using (StreamReader reader = new StreamReader(fi.FullName))
            {
                var deserializer = new XmlSerializer(typeof(PlaylistSettings));
                return((PlaylistSettings)deserializer.Deserialize(reader));
            }
        }