public void HandleMessage(IBMessage message) { if (!this.Dispatcher.CheckAccess()) { MessageHandlerDelegate callback = new MessageHandlerDelegate(HandleMessage); this.Dispatcher.Invoke(callback, new object[] { message }); } else { UpdateUI(message); } }
public void UpdateUI(IBMessage message) { switch (message.Type) { case MessageType.AccountSummary: HandleAccountSummary((AccountSummaryMessage)message); break; case MessageType.AccountSummaryEnd: HandleAccountSummaryEnd(); break; default: break; } }
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; } }