Пример #1
0
 private static void PATS_OnConnectStateChanged(object sender, ConnectStateEventArgs e)
 {
     if (e.DLComplete)
     {
         if (ProductInfos == null)
         {
             ProductInfos = ProductInfo.Convert(PATS.Products());
             Center.Instance.Post(nameof(PATS), nameof(ProductInfos));
         }
         if (AccountInfos == null)
         {
             AccountInfos = AccountInfo.Convert(PATS.Traders());
             Center.Instance.Post(nameof(PATS), nameof(AccountInfos));
         }
     }
     else
     {
         if (ProductInfos != null)
         {
             ProductInfos.Clear();
             Center.Instance.Post(nameof(PATS), nameof(ProductInfos));
         }
         if (AccountInfos != null)
         {
             AccountInfos.Clear();
             Center.Instance.Post(nameof(PATS), nameof(AccountInfos));
         }
     }
 }
Пример #2
0
 private static void PATS_OnConnectStateChanged(object sender, ConnectStateEventArgs e)
 {
     if (e.DLComplete)
     {
         if (ExchangeInfo == null)
         {
             ExchangeInfo = new ExchInfo();
         }
         if (ProductInfos == null)
         {
             //ProductInfos = ProductInfo.Convert(PATS.Products(), PATS.OrderTypes());
             ProductInfos = ProductInfo.Convert(PATS.Products());
             Center.Instance.Post(Observer.PATS, nameof(ProductInfos));
         }
         if (AccountInfos == null)
         {
             AccountInfos = AccountInfo.Convert(PATS.Traders());
             Center.Instance.Post(Observer.PATS, nameof(AccountInfos));
         }
     }
     else
     {
         if (ExchangeInfo != null)
         {
             ExchangeInfo = null;
         }
         if (ProductInfos != null)
         {
             ProductInfos.Clear();
             Center.Instance.Post(Observer.PATS, nameof(ProductInfos));
         }
         if (AccountInfos != null)
         {
             AccountInfos.Clear();
             Center.Instance.Post(Observer.PATS, nameof(AccountInfos));
         }
     }
 }
Пример #3
0
 public static void ReloadProductInfo()
 {
     ProductInfos = ProductInfo.Convert(PATS.Products());
     //ProductInfos = ProductInfo.Convert(PATS.Products(), PATS.OrderTypes());
     Center.Instance.Post(Observer.PATS, nameof(ProductInfos));
 }
Пример #4
0
 public static void ReloadProductInfo()
 {
     ProductInfos = ProductInfo.Convert(PATS.Products());
     Center.Instance.Post(nameof(PATS), nameof(ProductInfos));
 }