示例#1
0
 public void HandleMessage(IBMessage message)
 {
     if (!this.Dispatcher.CheckAccess())
     {
         MessageHandlerDelegate callback = new MessageHandlerDelegate(HandleMessage);
         this.Dispatcher.Invoke(callback, new object[] { message });
     }
     else
     {
         UpdateUI(message);
     }
 }
示例#2
0
        public void UpdateUI(IBMessage message)
        {
            switch (message.Type)
            {
            case MessageType.AccountSummary:
                HandleAccountSummary((AccountSummaryMessage)message);
                break;

            case MessageType.AccountSummaryEnd:
                HandleAccountSummaryEnd();
                break;

            default:
                break;
            }
        }
示例#3
0
        public void UpdateUI(IBMessage message)
        {
            switch (message.Type)
            {
            case MessageType.ManagedAccounts:
                accountManager.ManageAccounts = ((ManageAccountsMessage)message).ManageAccounts;
                accountList.ItemsSource       = ((ManageAccountsMessage)message).ManageAccounts.ToArray();
                break;

            case MessageType.AccountSummary:
                accountManager.UpdateUI(message);
                break;

            case MessageType.AccountSummaryEnd:
                accountManager.UpdateUI(message);
                break;

            case MessageType.Error:
                ErrorMessage error = (ErrorMessage)message;
                ShowMessageOnPanel(error.ToString());
                break;

            case MessageType.ConnectionStatus:
                ConnectionStatusMessage statusMessage = (ConnectionStatusMessage)message;
                if (statusMessage.IsConnected)
                {
                }
                break;

            case MessageType.TickPrice:
                HandleTickMessage((MarketDataMessage)message);
                break;

            default:
                break;
            }
        }