public void LoadConfig() { if (File.Exists(ConfigFile)) { Config = SerializationUtil.DeserializationBinary <BingConfig>(ConfigFile); } else { Config = new BingConfig(); SaveConfig(); } }
/// <summary> /// 静态构造函数 /// </summary> static ConfigManager() { _initConfig = new BingConfig(); _initConfig.Logger.EnabledDebug = true; _initConfig.Logger.EnabledTrace = true; _initConfig.Logger.Level = "DEBUG"; _initConfig.Logger.Type = "File"; _initConfig.Logger.ProjectName = "JCE"; _initConfig.UserContext.EnabledUserName = false; }
/// <summary> /// Constructor /// </summary> /// <param name="bingConfig">Bing config information</param> public BingSearchRespository(IOptions <BingConfig> bingConfig) { _bingConfig = bingConfig.Value; }
public BingSearchEngineRepository(IOptions <BingConfig> bingConfig) { _bingConfig = bingConfig.Value; }