public AuthConfigFields(String name, String key, String description, AuthConfigTypes type, Boolean required, String defaultValue) { this.Name = name; this.Key = key; this.Description = description; this.Type = type; this.Required = required; this.DefaultValue = defaultValue; }
public static void FillConfig(AuthBase plugin, ref Dictionary <String, Object> config, String key, Object value) { /*if (!connectorConf.ContainsKey(d1[kCol])) * connectorConf.Add(d1[kCol], d1[vCol].ToString());*/ AuthConfigTypes type = AuthConfigTypes.String; List <AuthConfigFields> cfg = new List <AuthConfigFields>(); AuthConfigFields[] tmp = plugin.GetConfigFields(); if (tmp != null) { cfg.AddRange(tmp); } tmp = null; AuthConfigFields fCfg = cfg.Find(c => (c.Key.ToLower() == key)); if (fCfg != null) { type = fCfg.Type; } switch (type) { case AuthConfigTypes.Boolean: case AuthConfigTypes.Uri: case AuthConfigTypes.Int32: case AuthConfigTypes.Int64: case AuthConfigTypes.DateTime: case AuthConfigTypes.String: case AuthConfigTypes.Password: if (!config.ContainsKey(key)) { config.Add(key, value); } break; } }