Example #1
0
 /// <summary>
 /// 取得实例.
 /// </summary>
 /// <returns>实例.</returns>
 /// <param name="iPath">读取路径.</param>
 public static T1 GetInstance(string iPath = null)
 {
     if (_instance == null)
     {
         _instance = UtilsAsset.ReadSetting <T1>(iPath);
         string _name = typeof(T1).Name;
         if ((null != _instance) && (true == _instance.Init()))
         {
             UtilsLog.Info(_name, "GetInstance Successed!!!");
         }
         else
         {
             UtilsLog.Error(_name, "GetInstance Failed!!!");
             return(null);
         }
     }
     return(_instance);
 }
Example #2
0
 /// <summary>
 /// 取得实例.
 /// </summary>
 /// <returns>实例.</returns>
 /// <param name="iPath">读取路径.</param>
 public static T1 GetInstance(string iPath = null)
 {
     if (_instance == null)
     {
         _instance = UtilsAsset.ReadSetting <T1>(iPath);
         string _name = typeof(T1).Name;
         if ((null != _instance) && (true == _instance.Init()))
         {
             UtilsLog.Info(_name, "GetInstance()::Successed!!!(Path:{0})",
                           (true == string.IsNullOrEmpty(iPath)) ? "null" : iPath);
         }
         else
         {
             UtilsLog.Error(_name, "GetInstance()::Failed!!!(Path:{0})",
                            (true == string.IsNullOrEmpty(iPath)) ? "null" : iPath);
             return(null);
         }
     }
     return(_instance);
 }