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)); } } }
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)); } } }
public static void ReloadProductInfo() { ProductInfos = ProductInfo.Convert(PATS.Products()); //ProductInfos = ProductInfo.Convert(PATS.Products(), PATS.OrderTypes()); Center.Instance.Post(Observer.PATS, nameof(ProductInfos)); }
public static void ReloadProductInfo() { ProductInfos = ProductInfo.Convert(PATS.Products()); Center.Instance.Post(nameof(PATS), nameof(ProductInfos)); }