Esempio n. 1
0
 /// <summary>
 /// 动态创建实例
 /// </summary>
 /// <typeparam name="T">目标类型</typeparam>
 /// <param name="type">类型</param>
 /// <param name="parameters">传递给构造函数的参数</param>
 public static T CreateInstance <T>(Type type, params object[] parameters) => Conv.To <T>(Activator.CreateInstance(type, parameters));
Esempio n. 2
0
 /// <summary>
 /// 设置时间
 /// </summary>
 /// <param name="dateTime">时间</param>
 public static void SetTime(string dateTime)
 {
     _dateTime = Conv.ToDateOrNull(dateTime);
 }