public CCError ValidateSettings(PluginSettingDetail setting)
            {
                string result = _plugin.ValidateSettings(V2Converter.ConvertSettingDetailToV2(setting));

                CCError ret = new CCError()
                {
                    source       = string.IsNullOrEmpty(result) ? CCError.CCErrorSource.None : CCError.CCErrorSource.Internal,
                    ErrorMessage = result
                };

                return(ret);
            }
 public static void FillV1Settings(IList <V1.ISettingsDetail> v1List, IEnumerable <V2.SettingsDetail> v2List)
 {
     foreach (var v2Setting in v2List)
     {
         var v1Setting = new PluginSettingDetail()
         {
             DetailID             = v2Setting.DetailID,
             Descr                = v2Setting.Descr,
             Value                = v2Setting.DefaultValue,
             IsEncryptionRequired = v2Setting.IsEncryptionRequired,
             ControlType          = ToV1(v2Setting.ControlType)
         };
         List <KeyValuePair <string, string> > comboList = null;
         if (v2Setting.ComboValues != null)
         {
             comboList = new List <KeyValuePair <string, string> >(v2Setting.ComboValues);
         }
         v1Setting.SetComboValues(comboList);
         v1List.Add(v1Setting);
     }
 }
Beispiel #3
0
 public static V2.SettingsValue ConvertSettingDetailToV2(PluginSettingDetail detail)
 {
     return(Mapper.Map <V2.SettingsValue>(detail));
 }