Refactored MtApi4 (MT4) for working with new architecture

This commit is contained in:
Viacheslav Demydiuk
2024-06-16 13:57:50 +03:00
parent 6dd5e0190f
commit a830dc11a6
89 changed files with 1648 additions and 2390 deletions
+3 -8
View File
@@ -1,15 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MtApi
namespace MtApi
{
class MtApiTimeConverter
{
public static DateTime ConvertFromMtTime(int time)
{
DateTime tmpTime = new DateTime(1970, 1, 1);
DateTime tmpTime = new(1970, 1, 1);
return new DateTime(tmpTime.Ticks + (time * 0x989680L));
}
@@ -18,7 +13,7 @@ namespace MtApi
int result = 0;
if (time != null && time != DateTime.MinValue)
{
DateTime tmpTime = new DateTime(1970, 1, 1);
DateTime tmpTime = new(1970, 1, 1);
result = (int)((time.Value.Ticks - tmpTime.Ticks) / 0x989680L);
}
return result;