/// <summary> /// 返回配置项当前值或默认值(默认值不能为空) /// </summary> /// <typeparam name="T"></typeparam> /// <returns>返回配置项当前值或默认值(默认值不能为空)</returns> protected static T Load <T>() where T : JsonConfigBase, new() { return(JsonConfigHelper.GetCurrent <T>(() => { var temp = new T(); return temp.GetConfigFile(); })); }
/// <summary> /// 保存并刷新配置 /// </summary> public void Flush() { JsonConfigHelper.Save(this, this.GetConfigFile); }
/// <summary> /// 返回配置项当前值或默认值(默认值不能为空) /// </summary> /// <param name="elementType"></param> /// <param name="getConfigfileFunc"></param> /// <param name="newFunc"></param> /// <returns></returns> internal static object Load(Type elementType, Func <string> getConfigfileFunc, Func <object> newFunc) { return(JsonConfigHelper.GetCurrent(elementType, getConfigfileFunc, newFunc)); }