Exemplo n.º 1
0
 private void OrdersUpdated(object sender, OrdersUpdatedEventArgs e)
 {
     //L.Instance.Debug("e: {0}", e);
     var status = e.Status;
     var price = e.Price;
     var balance = e.Balance;
     var order = FindOrder(e.OrderNo);
     if (order != null)
     {
         lock (_locker)
         {
             var state = new OrderState { Status = status, Balance = balance, Timestamp = e.Updated };
             order.SetState(state);
             order.Price = price;
             //L.Instance.Trace("order {0}", order);
         }
     }
 }
Exemplo n.º 2
0
 protected override void OnRowUpdated(RowUpdateType updateType, int rowId)
 {
     lock (_locker)
     {
         if (Updated != null)
         {
             var orderNo = GetOrderNo(rowId);
             var status = GetStatus(rowId);
             var price = GetPrice(rowId);
             var balance = GetBalance(rowId);
             var e = new OrdersUpdatedEventArgs(DateTime.Now, orderNo, status, price, balance);
             Updated(this, e);
         }
     }
 }