private void LoadFrom(FileInfo file) { IsNew = false; var s = new XmlSerializer(typeof(ConfigurationMemento)); using(var reader = file.OpenText()) { _memento = (ConfigurationMemento) s.Deserialize(reader); } }
public Configuration() { _memento = new ConfigurationMemento(); _file = new FileInfo(Environment.CurrentDirectory + "\\" + DEFAULT_FILE_NAME); if (_file.Exists) LoadFrom(_file); else CreateNew(_file); }