public static void saveSettings(MainSettings settings)
 {
     XmlSerializer s = new XmlSerializer(typeof(MainSettings));
     TextWriter w = new StreamWriter("settings.xml");
     s.Serialize(w, settings);
     w.Close();
 }
        public static MainSettings loadSettings()
        {
            MainSettings settings = new MainSettings();
            XmlSerializer s = new XmlSerializer(typeof(MainSettings));

            TextReader r = new StreamReader("settings.xml");
            settings = (MainSettings)s.Deserialize(r);
            r.Close();

            return settings;
        }
Exemple #3
0
 public void saveMe()
 {
     MainSettings main = new MainSettings();
     main.disableVideoAdvert = titleAdvert.Checked;
     main.ignoreAttachments = ignoreAttachments.Checked;
     main.ignoreAudio = audioSkip.Checked;
     main.ignoreChapters = ignoreChapters.Checked;
     main.ignoreSubs = ignoreSubs.Checked;
     main.outputPath = outPutLocation.Text;
     main.processPriority = processPriority.SelectedIndex.ToString();
     main.continueAfterError = continueAfterError.Checked;
     main.language = languagesSelect.SelectedIndex;
     SettingsController.saveSettings(main);
 }
Exemple #4
0
        public void loadSettings(MainSettings settings)
        {

            titleAdvert.Checked = settings.disableVideoAdvert;
            outPutLocation.Text = settings.outputPath;
            processPriority.SelectedIndex = int.Parse(settings.processPriority);
            audioSkip.Checked = settings.ignoreAudio;
            ignoreAttachments.Checked = settings.ignoreAttachments;
            ignoreChapters.Checked = settings.ignoreChapters;
            ignoreSubs.Checked = settings.ignoreSubs;
            continueAfterError.Checked = settings.continueAfterError;
            languagesSelect.SelectedIndex = settings.language;
        }