public CoreYagoda(Logger logger) { this.logger = logger; var init = new InitYagodaCore(logger); setting = init.GetSetting(); }
/// <summary> /// Десерилизация xml файла с настройками в класс setting/ /// </summary> /// <returns></returns> public SettingYagodaCore GetSetting() { setting = new SettingYagodaCore(); FileStream fileStream = null; try { XmlSerializer xmlSerializer = new XmlSerializer(typeof(SettingYagodaCore)); fileStream = new FileStream("setting.xml", FileMode.Open); setting = (SettingYagodaCore)xmlSerializer.Deserialize(fileStream); } catch (Exception exp) { Console.WriteLine(exp.Message); } finally { if (fileStream != null) { fileStream.Close(); } ; } return(setting); }