예제 #1
0
 private void HandleDeletedLimitOrder(ILimitOrder order)
 {
     order.UnRegisterDeleteNotificationHandler(HandleDeletedLimitOrder);
     order.UnRegisterFilledNotification(HandleDeletedLimitOrder);
     LimitOrders.Remove(order.ExchangeOrderId);
     ClientOrders[order.ClientId].Remove(order);
 }
예제 #2
0
        void client_LimitOrderDeleted(object sender, LimitOrderDto e)
        {
            UiDispatcher.Dispatcher.Invoke(() =>
            {
                var order = LimitOrders.FirstOrDefault(a => a.OrderId == e.ExchangeOrderId);
                if (order == null)
                {
                    return;
                }

                LimitOrders.Remove(order);
                order.Dispose();
            });
        }
예제 #3
0
        void client_LimitOrderSnapshot(object sender, System.Collections.Generic.List <LimitOrderDto> e)
        {
            UiDispatcher.Dispatcher.Invoke(() =>
            {
                LimitOrders.Clear();
                foreach (var limitOrderViewModel in LimitOrders)
                {
                    LimitOrders.Remove(limitOrderViewModel);
                    limitOrderViewModel.Dispose();
                }

                foreach (var limitOrder in e)
                {
                    LimitOrders.Add(new LimitOrderViewModel(limitOrder, client));
                }
            });
        }