Пример #1
0
 private void CheckAndAddSetting(IList <StoreSetting> settings, string key, string value, IList <string> errorList)
 {
     try
     {
         if (settings.Find <StoreSetting>(delegate(StoreSetting s) { return(s.FieldName == key); }) == null)
         {
             StoreSetting setting = new StoreSetting(AbleContext.Current.Store, key, value);
             setting.Save();
             AbleContext.Current.Store.Settings.Add(setting);
         }
     }
     catch (Exception ex)
     {
         errorList.Add(string.Format("An error occurred while adding store setting key: '{0}', value: '{1}', error: {2}", key, value, ex.Message));
     }
 }