public ConfigSettingsSerializer()
 {
     this.settings = new SettingsClass();
     this.playlist = new ObservableCollection <TimerRow>();
     if (string.IsNullOrEmpty(fileName))
     {
         fileName = "ConfigSetings.e4e";
     }
 }
 public void ReadConfigFile()
 {
     try
     {
         using (Stream stream = File.Open(fileName, FileMode.Open))
         {
             XmlSerializer bin = new XmlSerializer(typeof(ConfigSettingsSerializer));
             var           tmp = (ConfigSettingsSerializer)bin.Deserialize(stream);
             PlayList = new ObservableCollection <TimerRow>();
             foreach (var item in tmp.PlayList)
             {
                 PlayList.Add(new TimerRow(item.Name, item.Duration, item.Comments, item.IsTimerDescending, item.ShouldAlertFire));
             }
             Settings = tmp.Settings;
         }
     } catch (FileNotFoundException)
     {
     }
 }
 public ConfigSettingsSerializer(ObservableCollection <TimerRow> time, SettingsClass settings, string fileName = "ConfigSetings.e4e")
 {
     this.settings = settings;
     this.playlist = time;
     this.fileName = fileName;
 }
示例#4
0
 public ConfigSettingsSerializer(ObservableCollection <TimerRow> time, SettingsClass settings)
 {
     this.settings = settings;
     this.playlist = time;
 }
示例#5
0
 public ConfigSettingsSerializer()
 {
     this.settings = new SettingsClass();
     this.playlist = new ObservableCollection <TimerRow>();
 }