Exemplo n.º 1
0
 /// <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();
     }) as T ?? new T());
 }
Exemplo n.º 2
0
 public void Save()
 {
     JsonConfigHelper.Save(this, this.GetConfigFile);
 }
Exemplo n.º 3
0
 /// <summary>
 /// 返回结果可能为空
 /// </summary>
 /// <param name="elementType"></param>
 /// <param name="getConfigfileFunc"></param>
 /// <returns></returns>
 internal static object Load(Type elementType, Func <string> getConfigfileFunc)
 {
     return(JsonConfigHelper.GetCurrent(elementType, getConfigfileFunc));
 }