static BaseConfigFactory() { lock (lockObject) { foreach (Type type in Assembly.GetCallingAssembly().GetTypes().Where(t => t.FullName.Contains("ConfigInfo"))) { if (typeof(IBaseConfigInfo).IsAssignableFrom(type)) { if (type == typeof(IBaseConfigInfo)) { continue; } IBaseConfigInfo baseConfig = (IBaseConfigInfo)Activator.CreateInstance(type); if (configurationDic == null) { configurationDic = new Dictionary <string, BaseConfigInfo>(); } if (baseConfig == null) { continue; } configurationDic.Add(baseConfig.ProviderName, new BaseConfigInfo(baseConfig)); } } } }
public BaseConfigInfo(IBaseConfigInfo baseConfigInfo) { instance = baseConfigInfo; }