Esempio n. 1
0
 public SettingsManager()
 {
     this.settings = new Settings();
     this.settingsFilePath = System.IO.Directory.GetCurrentDirectory() + "\\" + "settings.xml";
 }
Esempio n. 2
0
        public bool Read()
        {
            try
            {
                XmlSerializer serializer = XmlSerializer.FromTypes(new[] { typeof(Settings) })[0];
                using (FileStream fs = new FileStream(this.settingsFilePath, FileMode.Open))
                {
                    this.settings = (Settings)serializer.Deserialize(fs);
                }
            }
            catch (Exception)
            {
                return false;
            }

            return true;
        }