示例#1
0
 private void LoadFrom(FileInfo file)
 {
     IsNew = false;
     var s = new XmlSerializer(typeof(ConfigurationMemento));
     using(var reader = file.OpenText())
     {
         _memento =  (ConfigurationMemento) s.Deserialize(reader);
     }
 }
示例#2
0
        public Configuration()
        {
            _memento = new ConfigurationMemento();
            _file = new FileInfo(Environment.CurrentDirectory + "\\" + DEFAULT_FILE_NAME);

            if (_file.Exists)
                LoadFrom(_file);
            else
                CreateNew(_file);
        }