internal virtual bool ProcessMessage(FxMessage message) { switch (message.Type) { case Native.FX_MSG_LOGON: this.RaiseLogon(message); break; case Native.FX_MSG_LOGOUT: this.RaiseLogout(message); break; case Native.FX_MSG_SESSION_INFO: this.RaiseSessionInfo(message); break; case Native.FX_MSG_CACHE_UPDATED: this.RaiseCacheUpdated(message); break; case Native.FX_MSG_TWO_FACTOR_AUTH: this.RaiseTwoFactorAuth(message); break; default: return(false); } return(true); }
internal override bool ProcessMessage(FxMessage message) { if (base.ProcessMessage(message)) { return(true); } switch (message.Type) { case Native.FX_MSG_ACCOUNT_INFO: this.RaiseAccountInfo(message); break; case Native.FX_MSG_EXECUTION_REPORT: this.RaiseExecutionReport(message); break; case Native.FX_MSG_TRADE_TRANSACTION_REPORT: this.RaiseTradeTransactionReport(message); break; case Native.FX_MSG_POSITION_REPORT: this.RaisePositionReport(message); break; case Native.FX_MSG_NOTIFICATION: this.RaiseNotification(message); break; default: return(false); } return(true); }
internal DataEventArgs(FxMessage message) { if (message.SendingTime.HasValue) { this.SendingTime = message.SendingTime; } this.ReceivingTime = message.ReceivingTime.Value; }
void RaiseCurrencyInfo(FxMessage message) { var eh = this.CurrencyInfo; if (eh != null) { var e = new CurrencyInfoEventArgs(message); eh(this, e); } }
void RaiseUnsubscribed(FxMessage message) { var eh = this.Unsubscribed; if (eh != null) { var e = new UnsubscribedEventArgs(message); eh(this, e); } }
void RaiseSymbolInfo(FxMessage message) { var eh = this.SymbolInfo; if (eh != null) { var e = new SymbolInfoEventArgs(message, this.UsedProtocolVersion); eh(this, e); } }
void RaiseAccountInfo(FxMessage message) { var eh = this.AccountInfo; if (eh != null) { var e = new AccountInfoEventArgs(message); eh(this, e); } }
void RaiseCacheUpdated(FxMessage message) { var eh = this.CacheInitialized; if (eh != null) { var e = new CacheEventArgs(); eh(this, e); } }
void RaiseTradeTransactionReport(FxMessage message) { var eh = this.TradeTransactionReport; if (eh != null) { var e = new TradeTransactionReportEventArgs(message); eh(this, e); } }
void RaiseLogout(FxMessage message) { var eh = this.Logout; if (eh != null) { var e = new LogoutEventArgs(message); eh(this, e); } }
void RaiseTwoFactorAuth(FxMessage message) { var eh = this.TwoFactorAuth; if (eh != null) { var e = new TwoFactorAuthEventArgs(message); eh(this, e); } }
void RaisePositionReport(FxMessage message) { var eh = this.PositionReport; if (eh != null) { var e = new PositionReportEventArgs(message); eh(this, e); } }
void RaiseSessionInfo(FxMessage message) { var eh = this.SessionInfo; if (eh != null) { var e = new SessionInfoEventArgs(message); eh(this, e); } }
internal unsafe LogoutEventArgs(FxMessage message) : base(message) { string text; LogoutReason reason; int code; message.GetLogoutInfo(out text, out reason, out code); this.Text = text; this.Reason = reason; this.Code = code; }
void RaiseTick(FxMessage message) { #if LOG_PERFORMANCE ulong timestamp = loggerOut_.GetTimestamp(); string id = message.Quote().Id; loggerOut_.LogTimestamp(id, timestamp, "Tick"); #endif var eh = this.Tick; if (eh != null) { var e = new TickEventArgs(message); eh(this, e); } }
void SafeProcessMessage(FxMessage message) { #if !DEBUG try { #endif this.ProcessMessage(message); #if !DEBUG } catch { } #endif this.handle.DispatchMessage(message); }
internal override bool ProcessMessage(FxMessage message) { if (base.ProcessMessage(message)) { return(true); } switch (message.Type) { case Native.FX_MSG_SUBSCRIBED: this.RaiseSubscribed(message); this.RaiseTick(message); break; case Native.FX_MSG_UNSUBSCRIBED: this.RaiseUnsubscribed(message); break; case Native.FX_MSG_TICK: this.RaiseTick(message); break; case Native.FX_MSG_SYMBOL_INFO: this.RaiseSymbolInfo(message); break; case Native.FX_MSG_NOTIFICATION: var notification = message.Notification(); if (notification.Type == NotificationType.ConfigUpdated) { var e = new NotificationEventArgs(notification); this.RaiseNotification(e); } else { return(false); } break; case Native.FX_MSG_CURRENCY_INFO: this.RaiseCurrencyInfo(message); break; default: return(false); } return(true); }
void RaiseExecutionReport(FxMessage message) { #if LOG_PERFORMANCE if (message.ExecutionReport().ExecutionType == ExecutionType.Trade) { ulong timestamp = loggerOut_.GetTimestamp(); string id = message.ExecutionReport().ClientOrderId; loggerOut_.LogTimestamp(id, timestamp, "ExecReport"); } #endif var eh = this.ExecutionReport; if (eh != null) { var e = new ExecutionReportEventArgs(message); eh(this, e); } }
unsafe void RaiseNotification(FxMessage message) { var notification = message.Notification(); if (notification.Type == NotificationType.Balance) { var e = new NotificationEventArgs <BalanceOperation>(notification) { Data = new BalanceOperation(notification) }; this.RaiseBalanceOperationNotification(e); } else { var e = new NotificationEventArgs(notification); this.RaiseNotification(e); } }
internal unsafe SymbolInfoEventArgs(FxMessage message, string usedProtocolVersion) { var protocolVersion = new FixProtocolVersion(usedProtocolVersion); this.Information = message.Symbols(protocolVersion); }
internal unsafe ExecutionReportEventArgs(FxMessage message) { this.Report = message.ExecutionReport(); }
internal SubscribedEventArgs(FxMessage message) : base(message) { this.Tick = message.Quote(); }
internal unsafe CurrencyInfoEventArgs(FxMessage message) { this.Information = message.Currencies(); }
internal unsafe TradeTransactionReportEventArgs(FxMessage message) { this.Report = message.TradeTransactionReport(); }
internal unsafe LogonEventArgs(FxMessage message) : base(message) { this.ProtocolVersion = message.ProtocolVersion(); }
internal unsafe AccountInfoEventArgs(FxMessage message) { this.Information = message.AccountInfo(); }
internal UnsubscribedEventArgs(FxMessage message) : base(message) { this.Symbol = message.Symbol(); }
internal unsafe PositionReportEventArgs(FxMessage message) { this.Report = message.Position(); }
internal TwoFactorAuthEventArgs(FxMessage message) : base(message) { this.TwoFactorAuth = message.TwoFactorAuth(); }
internal TickEventArgs(FxMessage message) : base(message) { this.Tick = message.Quote(); }