コード例 #1
0
        /// <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;
        }
コード例 #2
0
ファイル: SettingsBLL.cs プロジェクト: samadm/ReportGenerator
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 public static void SaveSetting(Setting setting)
 {
     using (ISettingRepository setttingRepository = new SettingsRepository())
     {
         setttingRepository.SaveSetting(setting);
     }
 }
コード例 #3
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public void SaveSetting(Setting setting)
        {
            string settingFilePath = Path.Combine(this.GetApplicationPath(), Settings.Default.SettingFileName);

            SerializerHelper.SerializeToFile<Setting>(setting,settingFilePath);
        }