Пример #1
0
        public static AuthBase GetPlugin(Uri id)
        {
            AuthBase ret = null;

            List <AuthBase> tList = GetPlugins <AuthBase>(Assembly.GetExecutingAssembly());

            for (Int32 i = 0; i < tList.Count; i++)
            {
                if (tList[i].Equal(id))
                {
                    ret = tList[i];
                }
                else
                {
                    tList[i] = null;
                }
            }

            return(ret);
        }
Пример #2
0
        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;
            }
        }
Пример #3
0
 public Boolean Equal(AuthBase p)
 {
     return(p.GetPluginId().Equals(this.GetPluginId()));
 }