源战役客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1539 line
43 KiB

  1. //this source code was auto-generated by tolua#, do not modify it
  2. using System;
  3. using LuaInterface;
  4. public class System_DateTimeWrap
  5. {
  6. public static void Register(LuaState L)
  7. {
  8. L.BeginClass(typeof(System.DateTime), null);
  9. L.RegFunction("Add", Add);
  10. L.RegFunction("AddDays", AddDays);
  11. L.RegFunction("AddHours", AddHours);
  12. L.RegFunction("AddMilliseconds", AddMilliseconds);
  13. L.RegFunction("AddMinutes", AddMinutes);
  14. L.RegFunction("AddMonths", AddMonths);
  15. L.RegFunction("AddSeconds", AddSeconds);
  16. L.RegFunction("AddTicks", AddTicks);
  17. L.RegFunction("AddYears", AddYears);
  18. L.RegFunction("Compare", Compare);
  19. L.RegFunction("CompareTo", CompareTo);
  20. L.RegFunction("DaysInMonth", DaysInMonth);
  21. L.RegFunction("Equals", Equals);
  22. L.RegFunction("FromBinary", FromBinary);
  23. L.RegFunction("FromFileTime", FromFileTime);
  24. L.RegFunction("FromFileTimeUtc", FromFileTimeUtc);
  25. L.RegFunction("FromOADate", FromOADate);
  26. L.RegFunction("IsDaylightSavingTime", IsDaylightSavingTime);
  27. L.RegFunction("SpecifyKind", SpecifyKind);
  28. L.RegFunction("ToBinary", ToBinary);
  29. L.RegFunction("GetHashCode", GetHashCode);
  30. L.RegFunction("IsLeapYear", IsLeapYear);
  31. L.RegFunction("Parse", Parse);
  32. L.RegFunction("ParseExact", ParseExact);
  33. L.RegFunction("Subtract", Subtract);
  34. L.RegFunction("ToOADate", ToOADate);
  35. L.RegFunction("ToFileTime", ToFileTime);
  36. L.RegFunction("ToFileTimeUtc", ToFileTimeUtc);
  37. L.RegFunction("ToLocalTime", ToLocalTime);
  38. L.RegFunction("ToLongDateString", ToLongDateString);
  39. L.RegFunction("ToLongTimeString", ToLongTimeString);
  40. L.RegFunction("ToShortDateString", ToShortDateString);
  41. L.RegFunction("ToShortTimeString", ToShortTimeString);
  42. L.RegFunction("ToString", ToString);
  43. L.RegFunction("ToUniversalTime", ToUniversalTime);
  44. L.RegFunction("TryParse", TryParse);
  45. L.RegFunction("TryParseExact", TryParseExact);
  46. L.RegFunction("GetDateTimeFormats", GetDateTimeFormats);
  47. L.RegFunction("GetTypeCode", GetTypeCode);
  48. L.RegFunction("New", _CreateSystem_DateTime);
  49. L.RegFunction("__add", op_Addition);
  50. L.RegFunction("__sub", op_Subtraction);
  51. L.RegFunction("__eq", op_Equality);
  52. L.RegFunction("__tostring", ToLua.op_ToString);
  53. L.RegVar("MinValue", get_MinValue, null);
  54. L.RegVar("MaxValue", get_MaxValue, null);
  55. L.RegVar("Date", get_Date, null);
  56. L.RegVar("Day", get_Day, null);
  57. L.RegVar("DayOfWeek", get_DayOfWeek, null);
  58. L.RegVar("DayOfYear", get_DayOfYear, null);
  59. L.RegVar("Hour", get_Hour, null);
  60. L.RegVar("Kind", get_Kind, null);
  61. L.RegVar("Millisecond", get_Millisecond, null);
  62. L.RegVar("Minute", get_Minute, null);
  63. L.RegVar("Month", get_Month, null);
  64. L.RegVar("Now", get_Now, null);
  65. L.RegVar("UtcNow", get_UtcNow, null);
  66. L.RegVar("Second", get_Second, null);
  67. L.RegVar("Ticks", get_Ticks, null);
  68. L.RegVar("TimeOfDay", get_TimeOfDay, null);
  69. L.RegVar("Today", get_Today, null);
  70. L.RegVar("Year", get_Year, null);
  71. L.EndClass();
  72. }
  73. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  74. static int _CreateSystem_DateTime(IntPtr L)
  75. {
  76. try
  77. {
  78. int count = LuaDLL.lua_gettop(L);
  79. if (count == 1)
  80. {
  81. long arg0 = LuaDLL.tolua_checkint64(L, 1);
  82. System.DateTime obj = new System.DateTime(arg0);
  83. ToLua.PushValue(L, obj);
  84. return 1;
  85. }
  86. else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(long), typeof(System.DateTimeKind)))
  87. {
  88. long arg0 = LuaDLL.tolua_checkint64(L, 1);
  89. System.DateTimeKind arg1 = (System.DateTimeKind)ToLua.CheckObject(L, 2, typeof(System.DateTimeKind));
  90. System.DateTime obj = new System.DateTime(arg0, arg1);
  91. ToLua.PushValue(L, obj);
  92. return 1;
  93. }
  94. else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(int), typeof(int), typeof(int)))
  95. {
  96. int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
  97. int arg1 = (int)LuaDLL.luaL_checknumber(L, 2);
  98. int arg2 = (int)LuaDLL.luaL_checknumber(L, 3);
  99. System.DateTime obj = new System.DateTime(arg0, arg1, arg2);
  100. ToLua.PushValue(L, obj);
  101. return 1;
  102. }
  103. else if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(int), typeof(int), typeof(int), typeof(System.Globalization.Calendar)))
  104. {
  105. int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
  106. int arg1 = (int)LuaDLL.luaL_checknumber(L, 2);
  107. int arg2 = (int)LuaDLL.luaL_checknumber(L, 3);
  108. System.Globalization.Calendar arg3 = (System.Globalization.Calendar)ToLua.CheckObject(L, 4, typeof(System.Globalization.Calendar));
  109. System.DateTime obj = new System.DateTime(arg0, arg1, arg2, arg3);
  110. ToLua.PushValue(L, obj);
  111. return 1;
  112. }
  113. else if (count == 6 && TypeChecker.CheckTypes(L, 1, typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(int)))
  114. {
  115. int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
  116. int arg1 = (int)LuaDLL.luaL_checknumber(L, 2);
  117. int arg2 = (int)LuaDLL.luaL_checknumber(L, 3);
  118. int arg3 = (int)LuaDLL.luaL_checknumber(L, 4);
  119. int arg4 = (int)LuaDLL.luaL_checknumber(L, 5);
  120. int arg5 = (int)LuaDLL.luaL_checknumber(L, 6);
  121. System.DateTime obj = new System.DateTime(arg0, arg1, arg2, arg3, arg4, arg5);
  122. ToLua.PushValue(L, obj);
  123. return 1;
  124. }
  125. else if (count == 7 && TypeChecker.CheckTypes(L, 1, typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(System.DateTimeKind)))
  126. {
  127. int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
  128. int arg1 = (int)LuaDLL.luaL_checknumber(L, 2);
  129. int arg2 = (int)LuaDLL.luaL_checknumber(L, 3);
  130. int arg3 = (int)LuaDLL.luaL_checknumber(L, 4);
  131. int arg4 = (int)LuaDLL.luaL_checknumber(L, 5);
  132. int arg5 = (int)LuaDLL.luaL_checknumber(L, 6);
  133. System.DateTimeKind arg6 = (System.DateTimeKind)ToLua.CheckObject(L, 7, typeof(System.DateTimeKind));
  134. System.DateTime obj = new System.DateTime(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
  135. ToLua.PushValue(L, obj);
  136. return 1;
  137. }
  138. else if (count == 7 && TypeChecker.CheckTypes(L, 1, typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(System.Globalization.Calendar)))
  139. {
  140. int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
  141. int arg1 = (int)LuaDLL.luaL_checknumber(L, 2);
  142. int arg2 = (int)LuaDLL.luaL_checknumber(L, 3);
  143. int arg3 = (int)LuaDLL.luaL_checknumber(L, 4);
  144. int arg4 = (int)LuaDLL.luaL_checknumber(L, 5);
  145. int arg5 = (int)LuaDLL.luaL_checknumber(L, 6);
  146. System.Globalization.Calendar arg6 = (System.Globalization.Calendar)ToLua.CheckObject(L, 7, typeof(System.Globalization.Calendar));
  147. System.DateTime obj = new System.DateTime(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
  148. ToLua.PushValue(L, obj);
  149. return 1;
  150. }
  151. else if (count == 7 && TypeChecker.CheckTypes(L, 1, typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(int)))
  152. {
  153. int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
  154. int arg1 = (int)LuaDLL.luaL_checknumber(L, 2);
  155. int arg2 = (int)LuaDLL.luaL_checknumber(L, 3);
  156. int arg3 = (int)LuaDLL.luaL_checknumber(L, 4);
  157. int arg4 = (int)LuaDLL.luaL_checknumber(L, 5);
  158. int arg5 = (int)LuaDLL.luaL_checknumber(L, 6);
  159. int arg6 = (int)LuaDLL.luaL_checknumber(L, 7);
  160. System.DateTime obj = new System.DateTime(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
  161. ToLua.PushValue(L, obj);
  162. return 1;
  163. }
  164. else if (count == 8 && TypeChecker.CheckTypes(L, 1, typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(System.DateTimeKind)))
  165. {
  166. int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
  167. int arg1 = (int)LuaDLL.luaL_checknumber(L, 2);
  168. int arg2 = (int)LuaDLL.luaL_checknumber(L, 3);
  169. int arg3 = (int)LuaDLL.luaL_checknumber(L, 4);
  170. int arg4 = (int)LuaDLL.luaL_checknumber(L, 5);
  171. int arg5 = (int)LuaDLL.luaL_checknumber(L, 6);
  172. int arg6 = (int)LuaDLL.luaL_checknumber(L, 7);
  173. System.DateTimeKind arg7 = (System.DateTimeKind)ToLua.CheckObject(L, 8, typeof(System.DateTimeKind));
  174. System.DateTime obj = new System.DateTime(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
  175. ToLua.PushValue(L, obj);
  176. return 1;
  177. }
  178. else if (count == 8 && TypeChecker.CheckTypes(L, 1, typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(System.Globalization.Calendar)))
  179. {
  180. int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
  181. int arg1 = (int)LuaDLL.luaL_checknumber(L, 2);
  182. int arg2 = (int)LuaDLL.luaL_checknumber(L, 3);
  183. int arg3 = (int)LuaDLL.luaL_checknumber(L, 4);
  184. int arg4 = (int)LuaDLL.luaL_checknumber(L, 5);
  185. int arg5 = (int)LuaDLL.luaL_checknumber(L, 6);
  186. int arg6 = (int)LuaDLL.luaL_checknumber(L, 7);
  187. System.Globalization.Calendar arg7 = (System.Globalization.Calendar)ToLua.CheckObject(L, 8, typeof(System.Globalization.Calendar));
  188. System.DateTime obj = new System.DateTime(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
  189. ToLua.PushValue(L, obj);
  190. return 1;
  191. }
  192. else if (count == 9 && TypeChecker.CheckTypes(L, 1, typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(System.Globalization.Calendar), typeof(System.DateTimeKind)))
  193. {
  194. int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
  195. int arg1 = (int)LuaDLL.luaL_checknumber(L, 2);
  196. int arg2 = (int)LuaDLL.luaL_checknumber(L, 3);
  197. int arg3 = (int)LuaDLL.luaL_checknumber(L, 4);
  198. int arg4 = (int)LuaDLL.luaL_checknumber(L, 5);
  199. int arg5 = (int)LuaDLL.luaL_checknumber(L, 6);
  200. int arg6 = (int)LuaDLL.luaL_checknumber(L, 7);
  201. System.Globalization.Calendar arg7 = (System.Globalization.Calendar)ToLua.CheckObject(L, 8, typeof(System.Globalization.Calendar));
  202. System.DateTimeKind arg8 = (System.DateTimeKind)ToLua.CheckObject(L, 9, typeof(System.DateTimeKind));
  203. System.DateTime obj = new System.DateTime(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
  204. ToLua.PushValue(L, obj);
  205. return 1;
  206. }
  207. else if (count == 0)
  208. {
  209. System.DateTime obj = new System.DateTime();
  210. ToLua.PushValue(L, obj);
  211. return 1;
  212. }
  213. else
  214. {
  215. return LuaDLL.luaL_throw(L, "invalid arguments to ctor method: System.DateTime.New");
  216. }
  217. }
  218. catch(Exception e)
  219. {
  220. return LuaDLL.toluaL_exception(L, e);
  221. }
  222. }
  223. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  224. static int Add(IntPtr L)
  225. {
  226. try
  227. {
  228. ToLua.CheckArgsCount(L, 2);
  229. System.DateTime obj = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  230. System.TimeSpan arg0 = (System.TimeSpan)ToLua.CheckObject(L, 2, typeof(System.TimeSpan));
  231. System.DateTime o = obj.Add(arg0);
  232. ToLua.PushValue(L, o);
  233. ToLua.SetBack(L, 1, obj);
  234. return 1;
  235. }
  236. catch(Exception e)
  237. {
  238. return LuaDLL.toluaL_exception(L, e);
  239. }
  240. }
  241. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  242. static int AddDays(IntPtr L)
  243. {
  244. try
  245. {
  246. ToLua.CheckArgsCount(L, 2);
  247. System.DateTime obj = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  248. double arg0 = (double)LuaDLL.luaL_checknumber(L, 2);
  249. System.DateTime o = obj.AddDays(arg0);
  250. ToLua.PushValue(L, o);
  251. ToLua.SetBack(L, 1, obj);
  252. return 1;
  253. }
  254. catch(Exception e)
  255. {
  256. return LuaDLL.toluaL_exception(L, e);
  257. }
  258. }
  259. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  260. static int AddHours(IntPtr L)
  261. {
  262. try
  263. {
  264. ToLua.CheckArgsCount(L, 2);
  265. System.DateTime obj = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  266. double arg0 = (double)LuaDLL.luaL_checknumber(L, 2);
  267. System.DateTime o = obj.AddHours(arg0);
  268. ToLua.PushValue(L, o);
  269. ToLua.SetBack(L, 1, obj);
  270. return 1;
  271. }
  272. catch(Exception e)
  273. {
  274. return LuaDLL.toluaL_exception(L, e);
  275. }
  276. }
  277. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  278. static int AddMilliseconds(IntPtr L)
  279. {
  280. try
  281. {
  282. ToLua.CheckArgsCount(L, 2);
  283. System.DateTime obj = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  284. double arg0 = (double)LuaDLL.luaL_checknumber(L, 2);
  285. System.DateTime o = obj.AddMilliseconds(arg0);
  286. ToLua.PushValue(L, o);
  287. ToLua.SetBack(L, 1, obj);
  288. return 1;
  289. }
  290. catch(Exception e)
  291. {
  292. return LuaDLL.toluaL_exception(L, e);
  293. }
  294. }
  295. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  296. static int AddMinutes(IntPtr L)
  297. {
  298. try
  299. {
  300. ToLua.CheckArgsCount(L, 2);
  301. System.DateTime obj = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  302. double arg0 = (double)LuaDLL.luaL_checknumber(L, 2);
  303. System.DateTime o = obj.AddMinutes(arg0);
  304. ToLua.PushValue(L, o);
  305. ToLua.SetBack(L, 1, obj);
  306. return 1;
  307. }
  308. catch(Exception e)
  309. {
  310. return LuaDLL.toluaL_exception(L, e);
  311. }
  312. }
  313. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  314. static int AddMonths(IntPtr L)
  315. {
  316. try
  317. {
  318. ToLua.CheckArgsCount(L, 2);
  319. System.DateTime obj = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  320. int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
  321. System.DateTime o = obj.AddMonths(arg0);
  322. ToLua.PushValue(L, o);
  323. ToLua.SetBack(L, 1, obj);
  324. return 1;
  325. }
  326. catch(Exception e)
  327. {
  328. return LuaDLL.toluaL_exception(L, e);
  329. }
  330. }
  331. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  332. static int AddSeconds(IntPtr L)
  333. {
  334. try
  335. {
  336. ToLua.CheckArgsCount(L, 2);
  337. System.DateTime obj = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  338. double arg0 = (double)LuaDLL.luaL_checknumber(L, 2);
  339. System.DateTime o = obj.AddSeconds(arg0);
  340. ToLua.PushValue(L, o);
  341. ToLua.SetBack(L, 1, obj);
  342. return 1;
  343. }
  344. catch(Exception e)
  345. {
  346. return LuaDLL.toluaL_exception(L, e);
  347. }
  348. }
  349. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  350. static int AddTicks(IntPtr L)
  351. {
  352. try
  353. {
  354. ToLua.CheckArgsCount(L, 2);
  355. System.DateTime obj = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  356. long arg0 = LuaDLL.tolua_checkint64(L, 2);
  357. System.DateTime o = obj.AddTicks(arg0);
  358. ToLua.PushValue(L, o);
  359. ToLua.SetBack(L, 1, obj);
  360. return 1;
  361. }
  362. catch(Exception e)
  363. {
  364. return LuaDLL.toluaL_exception(L, e);
  365. }
  366. }
  367. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  368. static int AddYears(IntPtr L)
  369. {
  370. try
  371. {
  372. ToLua.CheckArgsCount(L, 2);
  373. System.DateTime obj = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  374. int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
  375. System.DateTime o = obj.AddYears(arg0);
  376. ToLua.PushValue(L, o);
  377. ToLua.SetBack(L, 1, obj);
  378. return 1;
  379. }
  380. catch(Exception e)
  381. {
  382. return LuaDLL.toluaL_exception(L, e);
  383. }
  384. }
  385. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  386. static int Compare(IntPtr L)
  387. {
  388. try
  389. {
  390. ToLua.CheckArgsCount(L, 2);
  391. System.DateTime arg0 = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  392. System.DateTime arg1 = (System.DateTime)ToLua.CheckObject(L, 2, typeof(System.DateTime));
  393. int o = System.DateTime.Compare(arg0, arg1);
  394. LuaDLL.lua_pushinteger(L, o);
  395. return 1;
  396. }
  397. catch(Exception e)
  398. {
  399. return LuaDLL.toluaL_exception(L, e);
  400. }
  401. }
  402. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  403. static int CompareTo(IntPtr L)
  404. {
  405. try
  406. {
  407. int count = LuaDLL.lua_gettop(L);
  408. if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(System.DateTime), typeof(System.DateTime)))
  409. {
  410. System.DateTime obj = (System.DateTime)ToLua.ToObject(L, 1);
  411. System.DateTime arg0 = (System.DateTime)ToLua.ToObject(L, 2);
  412. int o = obj.CompareTo(arg0);
  413. LuaDLL.lua_pushinteger(L, o);
  414. ToLua.SetBack(L, 1, obj);
  415. return 1;
  416. }
  417. else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(System.DateTime), typeof(object)))
  418. {
  419. System.DateTime obj = (System.DateTime)ToLua.ToObject(L, 1);
  420. object arg0 = ToLua.ToVarObject(L, 2);
  421. int o = obj.CompareTo(arg0);
  422. LuaDLL.lua_pushinteger(L, o);
  423. ToLua.SetBack(L, 1, obj);
  424. return 1;
  425. }
  426. else
  427. {
  428. return LuaDLL.luaL_throw(L, "invalid arguments to method: System.DateTime.CompareTo");
  429. }
  430. }
  431. catch(Exception e)
  432. {
  433. return LuaDLL.toluaL_exception(L, e);
  434. }
  435. }
  436. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  437. static int DaysInMonth(IntPtr L)
  438. {
  439. try
  440. {
  441. ToLua.CheckArgsCount(L, 2);
  442. int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
  443. int arg1 = (int)LuaDLL.luaL_checknumber(L, 2);
  444. int o = System.DateTime.DaysInMonth(arg0, arg1);
  445. LuaDLL.lua_pushinteger(L, o);
  446. return 1;
  447. }
  448. catch(Exception e)
  449. {
  450. return LuaDLL.toluaL_exception(L, e);
  451. }
  452. }
  453. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  454. static int Equals(IntPtr L)
  455. {
  456. try
  457. {
  458. int count = LuaDLL.lua_gettop(L);
  459. if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(System.DateTime), typeof(System.DateTime)))
  460. {
  461. System.DateTime obj = (System.DateTime)ToLua.ToObject(L, 1);
  462. System.DateTime arg0 = (System.DateTime)ToLua.ToObject(L, 2);
  463. bool o = obj.Equals(arg0);
  464. LuaDLL.lua_pushboolean(L, o);
  465. ToLua.SetBack(L, 1, obj);
  466. return 1;
  467. }
  468. else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(System.DateTime), typeof(object)))
  469. {
  470. System.DateTime obj = (System.DateTime)ToLua.ToObject(L, 1);
  471. object arg0 = ToLua.ToVarObject(L, 2);
  472. bool o = obj.Equals(arg0);
  473. LuaDLL.lua_pushboolean(L, o);
  474. ToLua.SetBack(L, 1, obj);
  475. return 1;
  476. }
  477. else
  478. {
  479. return LuaDLL.luaL_throw(L, "invalid arguments to method: System.DateTime.Equals");
  480. }
  481. }
  482. catch(Exception e)
  483. {
  484. return LuaDLL.toluaL_exception(L, e);
  485. }
  486. }
  487. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  488. static int FromBinary(IntPtr L)
  489. {
  490. try
  491. {
  492. ToLua.CheckArgsCount(L, 1);
  493. long arg0 = LuaDLL.tolua_checkint64(L, 1);
  494. System.DateTime o = System.DateTime.FromBinary(arg0);
  495. ToLua.PushValue(L, o);
  496. return 1;
  497. }
  498. catch(Exception e)
  499. {
  500. return LuaDLL.toluaL_exception(L, e);
  501. }
  502. }
  503. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  504. static int FromFileTime(IntPtr L)
  505. {
  506. try
  507. {
  508. ToLua.CheckArgsCount(L, 1);
  509. long arg0 = LuaDLL.tolua_checkint64(L, 1);
  510. System.DateTime o = System.DateTime.FromFileTime(arg0);
  511. ToLua.PushValue(L, o);
  512. return 1;
  513. }
  514. catch(Exception e)
  515. {
  516. return LuaDLL.toluaL_exception(L, e);
  517. }
  518. }
  519. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  520. static int FromFileTimeUtc(IntPtr L)
  521. {
  522. try
  523. {
  524. ToLua.CheckArgsCount(L, 1);
  525. long arg0 = LuaDLL.tolua_checkint64(L, 1);
  526. System.DateTime o = System.DateTime.FromFileTimeUtc(arg0);
  527. ToLua.PushValue(L, o);
  528. return 1;
  529. }
  530. catch(Exception e)
  531. {
  532. return LuaDLL.toluaL_exception(L, e);
  533. }
  534. }
  535. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  536. static int FromOADate(IntPtr L)
  537. {
  538. try
  539. {
  540. ToLua.CheckArgsCount(L, 1);
  541. double arg0 = (double)LuaDLL.luaL_checknumber(L, 1);
  542. System.DateTime o = System.DateTime.FromOADate(arg0);
  543. ToLua.PushValue(L, o);
  544. return 1;
  545. }
  546. catch(Exception e)
  547. {
  548. return LuaDLL.toluaL_exception(L, e);
  549. }
  550. }
  551. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  552. static int IsDaylightSavingTime(IntPtr L)
  553. {
  554. try
  555. {
  556. ToLua.CheckArgsCount(L, 1);
  557. System.DateTime obj = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  558. bool o = obj.IsDaylightSavingTime();
  559. LuaDLL.lua_pushboolean(L, o);
  560. ToLua.SetBack(L, 1, obj);
  561. return 1;
  562. }
  563. catch(Exception e)
  564. {
  565. return LuaDLL.toluaL_exception(L, e);
  566. }
  567. }
  568. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  569. static int SpecifyKind(IntPtr L)
  570. {
  571. try
  572. {
  573. ToLua.CheckArgsCount(L, 2);
  574. System.DateTime arg0 = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  575. System.DateTimeKind arg1 = (System.DateTimeKind)ToLua.CheckObject(L, 2, typeof(System.DateTimeKind));
  576. System.DateTime o = System.DateTime.SpecifyKind(arg0, arg1);
  577. ToLua.PushValue(L, o);
  578. return 1;
  579. }
  580. catch(Exception e)
  581. {
  582. return LuaDLL.toluaL_exception(L, e);
  583. }
  584. }
  585. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  586. static int ToBinary(IntPtr L)
  587. {
  588. try
  589. {
  590. ToLua.CheckArgsCount(L, 1);
  591. System.DateTime obj = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  592. long o = obj.ToBinary();
  593. LuaDLL.tolua_pushint64(L, o);
  594. ToLua.SetBack(L, 1, obj);
  595. return 1;
  596. }
  597. catch(Exception e)
  598. {
  599. return LuaDLL.toluaL_exception(L, e);
  600. }
  601. }
  602. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  603. static int GetHashCode(IntPtr L)
  604. {
  605. try
  606. {
  607. ToLua.CheckArgsCount(L, 1);
  608. System.DateTime obj = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  609. int o = obj.GetHashCode();
  610. LuaDLL.lua_pushinteger(L, o);
  611. ToLua.SetBack(L, 1, obj);
  612. return 1;
  613. }
  614. catch(Exception e)
  615. {
  616. return LuaDLL.toluaL_exception(L, e);
  617. }
  618. }
  619. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  620. static int IsLeapYear(IntPtr L)
  621. {
  622. try
  623. {
  624. ToLua.CheckArgsCount(L, 1);
  625. int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
  626. bool o = System.DateTime.IsLeapYear(arg0);
  627. LuaDLL.lua_pushboolean(L, o);
  628. return 1;
  629. }
  630. catch(Exception e)
  631. {
  632. return LuaDLL.toluaL_exception(L, e);
  633. }
  634. }
  635. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  636. static int Parse(IntPtr L)
  637. {
  638. try
  639. {
  640. int count = LuaDLL.lua_gettop(L);
  641. if (count == 1 && TypeChecker.CheckTypes(L, 1, typeof(string)))
  642. {
  643. string arg0 = ToLua.ToString(L, 1);
  644. System.DateTime o = System.DateTime.Parse(arg0);
  645. ToLua.PushValue(L, o);
  646. return 1;
  647. }
  648. else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(string), typeof(System.IFormatProvider)))
  649. {
  650. string arg0 = ToLua.ToString(L, 1);
  651. System.IFormatProvider arg1 = (System.IFormatProvider)ToLua.ToObject(L, 2);
  652. System.DateTime o = System.DateTime.Parse(arg0, arg1);
  653. ToLua.PushValue(L, o);
  654. return 1;
  655. }
  656. else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(string), typeof(System.IFormatProvider), typeof(System.Globalization.DateTimeStyles)))
  657. {
  658. string arg0 = ToLua.ToString(L, 1);
  659. System.IFormatProvider arg1 = (System.IFormatProvider)ToLua.ToObject(L, 2);
  660. System.Globalization.DateTimeStyles arg2 = (System.Globalization.DateTimeStyles)ToLua.ToObject(L, 3);
  661. System.DateTime o = System.DateTime.Parse(arg0, arg1, arg2);
  662. ToLua.PushValue(L, o);
  663. return 1;
  664. }
  665. else
  666. {
  667. return LuaDLL.luaL_throw(L, "invalid arguments to method: System.DateTime.Parse");
  668. }
  669. }
  670. catch(Exception e)
  671. {
  672. return LuaDLL.toluaL_exception(L, e);
  673. }
  674. }
  675. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  676. static int ParseExact(IntPtr L)
  677. {
  678. try
  679. {
  680. int count = LuaDLL.lua_gettop(L);
  681. if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(string), typeof(string), typeof(System.IFormatProvider)))
  682. {
  683. string arg0 = ToLua.ToString(L, 1);
  684. string arg1 = ToLua.ToString(L, 2);
  685. System.IFormatProvider arg2 = (System.IFormatProvider)ToLua.ToObject(L, 3);
  686. System.DateTime o = System.DateTime.ParseExact(arg0, arg1, arg2);
  687. ToLua.PushValue(L, o);
  688. return 1;
  689. }
  690. else if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(string), typeof(string), typeof(System.IFormatProvider), typeof(System.Globalization.DateTimeStyles)))
  691. {
  692. string arg0 = ToLua.ToString(L, 1);
  693. string arg1 = ToLua.ToString(L, 2);
  694. System.IFormatProvider arg2 = (System.IFormatProvider)ToLua.ToObject(L, 3);
  695. System.Globalization.DateTimeStyles arg3 = (System.Globalization.DateTimeStyles)ToLua.ToObject(L, 4);
  696. System.DateTime o = System.DateTime.ParseExact(arg0, arg1, arg2, arg3);
  697. ToLua.PushValue(L, o);
  698. return 1;
  699. }
  700. else if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(string), typeof(string[]), typeof(System.IFormatProvider), typeof(System.Globalization.DateTimeStyles)))
  701. {
  702. string arg0 = ToLua.ToString(L, 1);
  703. string[] arg1 = ToLua.CheckStringArray(L, 2);
  704. System.IFormatProvider arg2 = (System.IFormatProvider)ToLua.ToObject(L, 3);
  705. System.Globalization.DateTimeStyles arg3 = (System.Globalization.DateTimeStyles)ToLua.ToObject(L, 4);
  706. System.DateTime o = System.DateTime.ParseExact(arg0, arg1, arg2, arg3);
  707. ToLua.PushValue(L, o);
  708. return 1;
  709. }
  710. else
  711. {
  712. return LuaDLL.luaL_throw(L, "invalid arguments to method: System.DateTime.ParseExact");
  713. }
  714. }
  715. catch(Exception e)
  716. {
  717. return LuaDLL.toluaL_exception(L, e);
  718. }
  719. }
  720. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  721. static int Subtract(IntPtr L)
  722. {
  723. try
  724. {
  725. int count = LuaDLL.lua_gettop(L);
  726. if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(System.DateTime), typeof(System.DateTime)))
  727. {
  728. System.DateTime obj = (System.DateTime)ToLua.ToObject(L, 1);
  729. System.DateTime arg0 = (System.DateTime)ToLua.ToObject(L, 2);
  730. System.TimeSpan o = obj.Subtract(arg0);
  731. ToLua.PushValue(L, o);
  732. ToLua.SetBack(L, 1, obj);
  733. return 1;
  734. }
  735. else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(System.DateTime), typeof(System.TimeSpan)))
  736. {
  737. System.DateTime obj = (System.DateTime)ToLua.ToObject(L, 1);
  738. System.TimeSpan arg0 = (System.TimeSpan)ToLua.ToObject(L, 2);
  739. System.DateTime o = obj.Subtract(arg0);
  740. ToLua.PushValue(L, o);
  741. ToLua.SetBack(L, 1, obj);
  742. return 1;
  743. }
  744. else
  745. {
  746. return LuaDLL.luaL_throw(L, "invalid arguments to method: System.DateTime.Subtract");
  747. }
  748. }
  749. catch(Exception e)
  750. {
  751. return LuaDLL.toluaL_exception(L, e);
  752. }
  753. }
  754. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  755. static int ToOADate(IntPtr L)
  756. {
  757. try
  758. {
  759. ToLua.CheckArgsCount(L, 1);
  760. System.DateTime obj = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  761. double o = obj.ToOADate();
  762. LuaDLL.lua_pushnumber(L, o);
  763. ToLua.SetBack(L, 1, obj);
  764. return 1;
  765. }
  766. catch(Exception e)
  767. {
  768. return LuaDLL.toluaL_exception(L, e);
  769. }
  770. }
  771. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  772. static int ToFileTime(IntPtr L)
  773. {
  774. try
  775. {
  776. ToLua.CheckArgsCount(L, 1);
  777. System.DateTime obj = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  778. long o = obj.ToFileTime();
  779. LuaDLL.tolua_pushint64(L, o);
  780. ToLua.SetBack(L, 1, obj);
  781. return 1;
  782. }
  783. catch(Exception e)
  784. {
  785. return LuaDLL.toluaL_exception(L, e);
  786. }
  787. }
  788. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  789. static int ToFileTimeUtc(IntPtr L)
  790. {
  791. try
  792. {
  793. ToLua.CheckArgsCount(L, 1);
  794. System.DateTime obj = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  795. long o = obj.ToFileTimeUtc();
  796. LuaDLL.tolua_pushint64(L, o);
  797. ToLua.SetBack(L, 1, obj);
  798. return 1;
  799. }
  800. catch(Exception e)
  801. {
  802. return LuaDLL.toluaL_exception(L, e);
  803. }
  804. }
  805. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  806. static int ToLocalTime(IntPtr L)
  807. {
  808. try
  809. {
  810. ToLua.CheckArgsCount(L, 1);
  811. System.DateTime obj = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  812. System.DateTime o = obj.ToLocalTime();
  813. ToLua.PushValue(L, o);
  814. ToLua.SetBack(L, 1, obj);
  815. return 1;
  816. }
  817. catch(Exception e)
  818. {
  819. return LuaDLL.toluaL_exception(L, e);
  820. }
  821. }
  822. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  823. static int ToLongDateString(IntPtr L)
  824. {
  825. try
  826. {
  827. ToLua.CheckArgsCount(L, 1);
  828. System.DateTime obj = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  829. string o = obj.ToLongDateString();
  830. LuaDLL.lua_pushstring(L, o);
  831. ToLua.SetBack(L, 1, obj);
  832. return 1;
  833. }
  834. catch(Exception e)
  835. {
  836. return LuaDLL.toluaL_exception(L, e);
  837. }
  838. }
  839. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  840. static int ToLongTimeString(IntPtr L)
  841. {
  842. try
  843. {
  844. ToLua.CheckArgsCount(L, 1);
  845. System.DateTime obj = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  846. string o = obj.ToLongTimeString();
  847. LuaDLL.lua_pushstring(L, o);
  848. ToLua.SetBack(L, 1, obj);
  849. return 1;
  850. }
  851. catch(Exception e)
  852. {
  853. return LuaDLL.toluaL_exception(L, e);
  854. }
  855. }
  856. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  857. static int ToShortDateString(IntPtr L)
  858. {
  859. try
  860. {
  861. ToLua.CheckArgsCount(L, 1);
  862. System.DateTime obj = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  863. string o = obj.ToShortDateString();
  864. LuaDLL.lua_pushstring(L, o);
  865. ToLua.SetBack(L, 1, obj);
  866. return 1;
  867. }
  868. catch(Exception e)
  869. {
  870. return LuaDLL.toluaL_exception(L, e);
  871. }
  872. }
  873. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  874. static int ToShortTimeString(IntPtr L)
  875. {
  876. try
  877. {
  878. ToLua.CheckArgsCount(L, 1);
  879. System.DateTime obj = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  880. string o = obj.ToShortTimeString();
  881. LuaDLL.lua_pushstring(L, o);
  882. ToLua.SetBack(L, 1, obj);
  883. return 1;
  884. }
  885. catch(Exception e)
  886. {
  887. return LuaDLL.toluaL_exception(L, e);
  888. }
  889. }
  890. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  891. static int ToString(IntPtr L)
  892. {
  893. try
  894. {
  895. int count = LuaDLL.lua_gettop(L);
  896. if (count == 1 && TypeChecker.CheckTypes(L, 1, typeof(System.DateTime)))
  897. {
  898. System.DateTime obj = (System.DateTime)ToLua.ToObject(L, 1);
  899. string o = obj.ToString();
  900. LuaDLL.lua_pushstring(L, o);
  901. return 1;
  902. }
  903. else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(System.DateTime), typeof(string)))
  904. {
  905. System.DateTime obj = (System.DateTime)ToLua.ToObject(L, 1);
  906. string arg0 = ToLua.ToString(L, 2);
  907. string o = obj.ToString(arg0);
  908. LuaDLL.lua_pushstring(L, o);
  909. return 1;
  910. }
  911. else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(System.DateTime), typeof(System.IFormatProvider)))
  912. {
  913. System.DateTime obj = (System.DateTime)ToLua.ToObject(L, 1);
  914. System.IFormatProvider arg0 = (System.IFormatProvider)ToLua.ToObject(L, 2);
  915. string o = obj.ToString(arg0);
  916. LuaDLL.lua_pushstring(L, o);
  917. return 1;
  918. }
  919. else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(System.DateTime), typeof(string), typeof(System.IFormatProvider)))
  920. {
  921. System.DateTime obj = (System.DateTime)ToLua.ToObject(L, 1);
  922. string arg0 = ToLua.ToString(L, 2);
  923. System.IFormatProvider arg1 = (System.IFormatProvider)ToLua.ToObject(L, 3);
  924. string o = obj.ToString(arg0, arg1);
  925. LuaDLL.lua_pushstring(L, o);
  926. return 1;
  927. }
  928. else
  929. {
  930. return LuaDLL.luaL_throw(L, "invalid arguments to method: System.DateTime.ToString");
  931. }
  932. }
  933. catch(Exception e)
  934. {
  935. return LuaDLL.toluaL_exception(L, e);
  936. }
  937. }
  938. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  939. static int ToUniversalTime(IntPtr L)
  940. {
  941. try
  942. {
  943. ToLua.CheckArgsCount(L, 1);
  944. System.DateTime obj = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  945. System.DateTime o = obj.ToUniversalTime();
  946. ToLua.PushValue(L, o);
  947. ToLua.SetBack(L, 1, obj);
  948. return 1;
  949. }
  950. catch(Exception e)
  951. {
  952. return LuaDLL.toluaL_exception(L, e);
  953. }
  954. }
  955. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  956. static int TryParse(IntPtr L)
  957. {
  958. try
  959. {
  960. int count = LuaDLL.lua_gettop(L);
  961. if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(string)))
  962. {
  963. string arg0 = ToLua.ToString(L, 1);
  964. System.DateTime arg1;
  965. bool o = System.DateTime.TryParse(arg0, out arg1);
  966. LuaDLL.lua_pushboolean(L, o);
  967. ToLua.PushValue(L, arg1);
  968. return 2;
  969. }
  970. else if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(string), typeof(System.IFormatProvider), typeof(System.Globalization.DateTimeStyles)))
  971. {
  972. string arg0 = ToLua.ToString(L, 1);
  973. System.IFormatProvider arg1 = (System.IFormatProvider)ToLua.ToObject(L, 2);
  974. System.Globalization.DateTimeStyles arg2 = (System.Globalization.DateTimeStyles)ToLua.ToObject(L, 3);
  975. System.DateTime arg3;
  976. bool o = System.DateTime.TryParse(arg0, arg1, arg2, out arg3);
  977. LuaDLL.lua_pushboolean(L, o);
  978. ToLua.PushValue(L, arg3);
  979. return 2;
  980. }
  981. else
  982. {
  983. return LuaDLL.luaL_throw(L, "invalid arguments to method: System.DateTime.TryParse");
  984. }
  985. }
  986. catch(Exception e)
  987. {
  988. return LuaDLL.toluaL_exception(L, e);
  989. }
  990. }
  991. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  992. static int TryParseExact(IntPtr L)
  993. {
  994. try
  995. {
  996. int count = LuaDLL.lua_gettop(L);
  997. if (count == 5 && TypeChecker.CheckTypes(L, 1, typeof(string), typeof(string), typeof(System.IFormatProvider), typeof(System.Globalization.DateTimeStyles)))
  998. {
  999. string arg0 = ToLua.ToString(L, 1);
  1000. string arg1 = ToLua.ToString(L, 2);
  1001. System.IFormatProvider arg2 = (System.IFormatProvider)ToLua.ToObject(L, 3);
  1002. System.Globalization.DateTimeStyles arg3 = (System.Globalization.DateTimeStyles)ToLua.ToObject(L, 4);
  1003. System.DateTime arg4;
  1004. bool o = System.DateTime.TryParseExact(arg0, arg1, arg2, arg3, out arg4);
  1005. LuaDLL.lua_pushboolean(L, o);
  1006. ToLua.PushValue(L, arg4);
  1007. return 2;
  1008. }
  1009. else if (count == 5 && TypeChecker.CheckTypes(L, 1, typeof(string), typeof(string[]), typeof(System.IFormatProvider), typeof(System.Globalization.DateTimeStyles)))
  1010. {
  1011. string arg0 = ToLua.ToString(L, 1);
  1012. string[] arg1 = ToLua.CheckStringArray(L, 2);
  1013. System.IFormatProvider arg2 = (System.IFormatProvider)ToLua.ToObject(L, 3);
  1014. System.Globalization.DateTimeStyles arg3 = (System.Globalization.DateTimeStyles)ToLua.ToObject(L, 4);
  1015. System.DateTime arg4;
  1016. bool o = System.DateTime.TryParseExact(arg0, arg1, arg2, arg3, out arg4);
  1017. LuaDLL.lua_pushboolean(L, o);
  1018. ToLua.PushValue(L, arg4);
  1019. return 2;
  1020. }
  1021. else
  1022. {
  1023. return LuaDLL.luaL_throw(L, "invalid arguments to method: System.DateTime.TryParseExact");
  1024. }
  1025. }
  1026. catch(Exception e)
  1027. {
  1028. return LuaDLL.toluaL_exception(L, e);
  1029. }
  1030. }
  1031. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  1032. static int op_Addition(IntPtr L)
  1033. {
  1034. try
  1035. {
  1036. ToLua.CheckArgsCount(L, 2);
  1037. System.DateTime arg0 = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  1038. System.TimeSpan arg1 = (System.TimeSpan)ToLua.CheckObject(L, 2, typeof(System.TimeSpan));
  1039. System.DateTime o = arg0 + arg1;
  1040. ToLua.PushValue(L, o);
  1041. return 1;
  1042. }
  1043. catch(Exception e)
  1044. {
  1045. return LuaDLL.toluaL_exception(L, e);
  1046. }
  1047. }
  1048. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  1049. static int op_Subtraction(IntPtr L)
  1050. {
  1051. try
  1052. {
  1053. int count = LuaDLL.lua_gettop(L);
  1054. if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(System.DateTime), typeof(System.TimeSpan)))
  1055. {
  1056. System.DateTime arg0 = (System.DateTime)ToLua.ToObject(L, 1);
  1057. System.TimeSpan arg1 = (System.TimeSpan)ToLua.ToObject(L, 2);
  1058. System.DateTime o = arg0 - arg1;
  1059. ToLua.PushValue(L, o);
  1060. return 1;
  1061. }
  1062. else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(System.DateTime), typeof(System.DateTime)))
  1063. {
  1064. System.DateTime arg0 = (System.DateTime)ToLua.ToObject(L, 1);
  1065. System.DateTime arg1 = (System.DateTime)ToLua.ToObject(L, 2);
  1066. System.TimeSpan o = arg0 - arg1;
  1067. ToLua.PushValue(L, o);
  1068. return 1;
  1069. }
  1070. else
  1071. {
  1072. return LuaDLL.luaL_throw(L, "invalid arguments to method: System.DateTime.op_Subtraction");
  1073. }
  1074. }
  1075. catch(Exception e)
  1076. {
  1077. return LuaDLL.toluaL_exception(L, e);
  1078. }
  1079. }
  1080. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  1081. static int op_Equality(IntPtr L)
  1082. {
  1083. try
  1084. {
  1085. ToLua.CheckArgsCount(L, 2);
  1086. System.DateTime arg0 = (System.DateTime)ToLua.ToObject(L, 1);
  1087. System.DateTime arg1 = (System.DateTime)ToLua.ToObject(L, 2);
  1088. bool o = arg0 == arg1;
  1089. LuaDLL.lua_pushboolean(L, o);
  1090. return 1;
  1091. }
  1092. catch(Exception e)
  1093. {
  1094. return LuaDLL.toluaL_exception(L, e);
  1095. }
  1096. }
  1097. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  1098. static int GetDateTimeFormats(IntPtr L)
  1099. {
  1100. try
  1101. {
  1102. int count = LuaDLL.lua_gettop(L);
  1103. if (count == 1 && TypeChecker.CheckTypes(L, 1, typeof(System.DateTime)))
  1104. {
  1105. System.DateTime obj = (System.DateTime)ToLua.ToObject(L, 1);
  1106. string[] o = obj.GetDateTimeFormats();
  1107. ToLua.Push(L, o);
  1108. ToLua.SetBack(L, 1, obj);
  1109. return 1;
  1110. }
  1111. else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(System.DateTime), typeof(System.IFormatProvider)))
  1112. {
  1113. System.DateTime obj = (System.DateTime)ToLua.ToObject(L, 1);
  1114. System.IFormatProvider arg0 = (System.IFormatProvider)ToLua.ToObject(L, 2);
  1115. string[] o = obj.GetDateTimeFormats(arg0);
  1116. ToLua.Push(L, o);
  1117. ToLua.SetBack(L, 1, obj);
  1118. return 1;
  1119. }
  1120. else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(System.DateTime), typeof(char)))
  1121. {
  1122. System.DateTime obj = (System.DateTime)ToLua.ToObject(L, 1);
  1123. char arg0 = (char)LuaDLL.lua_tonumber(L, 2);
  1124. string[] o = obj.GetDateTimeFormats(arg0);
  1125. ToLua.Push(L, o);
  1126. ToLua.SetBack(L, 1, obj);
  1127. return 1;
  1128. }
  1129. else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(System.DateTime), typeof(char), typeof(System.IFormatProvider)))
  1130. {
  1131. System.DateTime obj = (System.DateTime)ToLua.ToObject(L, 1);
  1132. char arg0 = (char)LuaDLL.lua_tonumber(L, 2);
  1133. System.IFormatProvider arg1 = (System.IFormatProvider)ToLua.ToObject(L, 3);
  1134. string[] o = obj.GetDateTimeFormats(arg0, arg1);
  1135. ToLua.Push(L, o);
  1136. ToLua.SetBack(L, 1, obj);
  1137. return 1;
  1138. }
  1139. else
  1140. {
  1141. return LuaDLL.luaL_throw(L, "invalid arguments to method: System.DateTime.GetDateTimeFormats");
  1142. }
  1143. }
  1144. catch(Exception e)
  1145. {
  1146. return LuaDLL.toluaL_exception(L, e);
  1147. }
  1148. }
  1149. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  1150. static int GetTypeCode(IntPtr L)
  1151. {
  1152. try
  1153. {
  1154. ToLua.CheckArgsCount(L, 1);
  1155. System.DateTime obj = (System.DateTime)ToLua.CheckObject(L, 1, typeof(System.DateTime));
  1156. System.TypeCode o = obj.GetTypeCode();
  1157. ToLua.Push(L, o);
  1158. ToLua.SetBack(L, 1, obj);
  1159. return 1;
  1160. }
  1161. catch(Exception e)
  1162. {
  1163. return LuaDLL.toluaL_exception(L, e);
  1164. }
  1165. }
  1166. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  1167. static int get_MinValue(IntPtr L)
  1168. {
  1169. try
  1170. {
  1171. ToLua.PushValue(L, System.DateTime.MinValue);
  1172. return 1;
  1173. }
  1174. catch(Exception e)
  1175. {
  1176. return LuaDLL.toluaL_exception(L, e);
  1177. }
  1178. }
  1179. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  1180. static int get_MaxValue(IntPtr L)
  1181. {
  1182. try
  1183. {
  1184. ToLua.PushValue(L, System.DateTime.MaxValue);
  1185. return 1;
  1186. }
  1187. catch(Exception e)
  1188. {
  1189. return LuaDLL.toluaL_exception(L, e);
  1190. }
  1191. }
  1192. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  1193. static int get_Date(IntPtr L)
  1194. {
  1195. object o = null;
  1196. try
  1197. {
  1198. o = ToLua.ToObject(L, 1);
  1199. System.DateTime obj = (System.DateTime)o;
  1200. System.DateTime ret = obj.Date;
  1201. ToLua.PushValue(L, ret);
  1202. return 1;
  1203. }
  1204. catch(Exception e)
  1205. {
  1206. return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Date on a nil value" : e.Message);
  1207. }
  1208. }
  1209. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  1210. static int get_Day(IntPtr L)
  1211. {
  1212. object o = null;
  1213. try
  1214. {
  1215. o = ToLua.ToObject(L, 1);
  1216. System.DateTime obj = (System.DateTime)o;
  1217. int ret = obj.Day;
  1218. LuaDLL.lua_pushinteger(L, ret);
  1219. return 1;
  1220. }
  1221. catch(Exception e)
  1222. {
  1223. return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Day on a nil value" : e.Message);
  1224. }
  1225. }
  1226. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  1227. static int get_DayOfWeek(IntPtr L)
  1228. {
  1229. object o = null;
  1230. try
  1231. {
  1232. o = ToLua.ToObject(L, 1);
  1233. System.DateTime obj = (System.DateTime)o;
  1234. System.DayOfWeek ret = obj.DayOfWeek;
  1235. ToLua.Push(L, ret);
  1236. return 1;
  1237. }
  1238. catch(Exception e)
  1239. {
  1240. return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index DayOfWeek on a nil value" : e.Message);
  1241. }
  1242. }
  1243. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  1244. static int get_DayOfYear(IntPtr L)
  1245. {
  1246. object o = null;
  1247. try
  1248. {
  1249. o = ToLua.ToObject(L, 1);
  1250. System.DateTime obj = (System.DateTime)o;
  1251. int ret = obj.DayOfYear;
  1252. LuaDLL.lua_pushinteger(L, ret);
  1253. return 1;
  1254. }
  1255. catch(Exception e)
  1256. {
  1257. return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index DayOfYear on a nil value" : e.Message);
  1258. }
  1259. }
  1260. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  1261. static int get_Hour(IntPtr L)
  1262. {
  1263. object o = null;
  1264. try
  1265. {
  1266. o = ToLua.ToObject(L, 1);
  1267. System.DateTime obj = (System.DateTime)o;
  1268. int ret = obj.Hour;
  1269. LuaDLL.lua_pushinteger(L, ret);
  1270. return 1;
  1271. }
  1272. catch(Exception e)
  1273. {
  1274. return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Hour on a nil value" : e.Message);
  1275. }
  1276. }
  1277. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  1278. static int get_Kind(IntPtr L)
  1279. {
  1280. object o = null;
  1281. try
  1282. {
  1283. o = ToLua.ToObject(L, 1);
  1284. System.DateTime obj = (System.DateTime)o;
  1285. System.DateTimeKind ret = obj.Kind;
  1286. ToLua.Push(L, ret);
  1287. return 1;
  1288. }
  1289. catch(Exception e)
  1290. {
  1291. return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Kind on a nil value" : e.Message);
  1292. }
  1293. }
  1294. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  1295. static int get_Millisecond(IntPtr L)
  1296. {
  1297. object o = null;
  1298. try
  1299. {
  1300. o = ToLua.ToObject(L, 1);
  1301. System.DateTime obj = (System.DateTime)o;
  1302. int ret = obj.Millisecond;
  1303. LuaDLL.lua_pushinteger(L, ret);
  1304. return 1;
  1305. }
  1306. catch(Exception e)
  1307. {
  1308. return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Millisecond on a nil value" : e.Message);
  1309. }
  1310. }
  1311. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  1312. static int get_Minute(IntPtr L)
  1313. {
  1314. object o = null;
  1315. try
  1316. {
  1317. o = ToLua.ToObject(L, 1);
  1318. System.DateTime obj = (System.DateTime)o;
  1319. int ret = obj.Minute;
  1320. LuaDLL.lua_pushinteger(L, ret);
  1321. return 1;
  1322. }
  1323. catch(Exception e)
  1324. {
  1325. return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Minute on a nil value" : e.Message);
  1326. }
  1327. }
  1328. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  1329. static int get_Month(IntPtr L)
  1330. {
  1331. object o = null;
  1332. try
  1333. {
  1334. o = ToLua.ToObject(L, 1);
  1335. System.DateTime obj = (System.DateTime)o;
  1336. int ret = obj.Month;
  1337. LuaDLL.lua_pushinteger(L, ret);
  1338. return 1;
  1339. }
  1340. catch(Exception e)
  1341. {
  1342. return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Month on a nil value" : e.Message);
  1343. }
  1344. }
  1345. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  1346. static int get_Now(IntPtr L)
  1347. {
  1348. try
  1349. {
  1350. ToLua.PushValue(L, System.DateTime.Now);
  1351. return 1;
  1352. }
  1353. catch(Exception e)
  1354. {
  1355. return LuaDLL.toluaL_exception(L, e);
  1356. }
  1357. }
  1358. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  1359. static int get_UtcNow(IntPtr L)
  1360. {
  1361. try
  1362. {
  1363. ToLua.PushValue(L, System.DateTime.UtcNow);
  1364. return 1;
  1365. }
  1366. catch(Exception e)
  1367. {
  1368. return LuaDLL.toluaL_exception(L, e);
  1369. }
  1370. }
  1371. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  1372. static int get_Second(IntPtr L)
  1373. {
  1374. object o = null;
  1375. try
  1376. {
  1377. o = ToLua.ToObject(L, 1);
  1378. System.DateTime obj = (System.DateTime)o;
  1379. int ret = obj.Second;
  1380. LuaDLL.lua_pushinteger(L, ret);
  1381. return 1;
  1382. }
  1383. catch(Exception e)
  1384. {
  1385. return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Second on a nil value" : e.Message);
  1386. }
  1387. }
  1388. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  1389. static int get_Ticks(IntPtr L)
  1390. {
  1391. object o = null;
  1392. try
  1393. {
  1394. o = ToLua.ToObject(L, 1);
  1395. System.DateTime obj = (System.DateTime)o;
  1396. long ret = obj.Ticks;
  1397. LuaDLL.tolua_pushint64(L, ret);
  1398. return 1;
  1399. }
  1400. catch(Exception e)
  1401. {
  1402. return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Ticks on a nil value" : e.Message);
  1403. }
  1404. }
  1405. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  1406. static int get_TimeOfDay(IntPtr L)
  1407. {
  1408. object o = null;
  1409. try
  1410. {
  1411. o = ToLua.ToObject(L, 1);
  1412. System.DateTime obj = (System.DateTime)o;
  1413. System.TimeSpan ret = obj.TimeOfDay;
  1414. ToLua.PushValue(L, ret);
  1415. return 1;
  1416. }
  1417. catch(Exception e)
  1418. {
  1419. return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index TimeOfDay on a nil value" : e.Message);
  1420. }
  1421. }
  1422. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  1423. static int get_Today(IntPtr L)
  1424. {
  1425. try
  1426. {
  1427. ToLua.PushValue(L, System.DateTime.Today);
  1428. return 1;
  1429. }
  1430. catch(Exception e)
  1431. {
  1432. return LuaDLL.toluaL_exception(L, e);
  1433. }
  1434. }
  1435. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  1436. static int get_Year(IntPtr L)
  1437. {
  1438. object o = null;
  1439. try
  1440. {
  1441. o = ToLua.ToObject(L, 1);
  1442. System.DateTime obj = (System.DateTime)o;
  1443. int ret = obj.Year;
  1444. LuaDLL.lua_pushinteger(L, ret);
  1445. return 1;
  1446. }
  1447. catch(Exception e)
  1448. {
  1449. return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Year on a nil value" : e.Message);
  1450. }
  1451. }
  1452. }