/// <summary> /// 加载配置,使用自定义配置工厂 /// </summary> /// <param name="configFactory">配置工厂</param> public static void LoadConfig(IConfigFactory configFactory) { if (configFactory == null) { throw new ArgumentNullException(nameof(configFactory)); } IClientConfig clientConfig = configFactory.CreateConfig(); LoadConfig(clientConfig); }
public Config InitConfig() { object obj = configHolder.Read(fileName); Config conf = obj as Config; if (conf != null) { return(conf); } return(configFactory.CreateConfig()); }