private void LoadSettings()
 {
     Settings   = SettingsLogic.GetSettings();
     FontSize   = Settings.FontSize;
     FinishTime = Settings.FinishTime;
     FontFamily = Settings.FontFamily;
     Note       = Settings.Note;
 }
 public void SaveSettings()
 {
     Settings.SelectedAccentName = SelectedAccent.Name;
     Settings.SelectedThemeName  = SelectedTheme.Name;
     Settings.FinishTime         = FinishTime;
     Settings.FontSize           = FontSize;
     Settings.FontFamily         = FontFamily;
     Settings.Note = Note;
     SettingsLogic.SaveSettings(Settings);
 }
Beispiel #3
0
        public static Settings GetSettings()
        {
            if (!File.Exists(SettingsPath))
            {
                return(SettingsLogic.GetDefaultSettings());
            }

            using (FileStream stream = new FileStream(SettingsPath, FileMode.OpenOrCreate))
            {
                var serializer = new XmlSerializer(typeof(Settings));
                return(serializer.Deserialize(stream) as Settings);
            }
        }