/// <summary> /// /// </summary> /// <returns></returns> public Setting GetSeting() { Setting setting; string settingFilePath = Path.Combine(this.GetApplicationPath(), Settings.Default.SettingFileName); if (File.Exists(settingFilePath)) { setting = SerializerHelper.DeserializeFromFile<Setting>(settingFilePath); } else { setting = new Setting(); } if(string.IsNullOrEmpty(setting.ReportingParameter.TemplatePath)) setting.ReportingParameter.TemplatePath = Path.Combine(this.GetApplicationPath(), Settings.Default.TemplateDirectory); return setting; }
/// <summary> /// /// </summary> /// <returns></returns> public static void SaveSetting(Setting setting) { using (ISettingRepository setttingRepository = new SettingsRepository()) { setttingRepository.SaveSetting(setting); } }
/// <summary> /// /// </summary> /// <returns></returns> public void SaveSetting(Setting setting) { string settingFilePath = Path.Combine(this.GetApplicationPath(), Settings.Default.SettingFileName); SerializerHelper.SerializeToFile<Setting>(setting,settingFilePath); }