Beispiel #1
0
 internal DataEventArgs(FxMessage message)
 {
     if (message.SendingTime.HasValue)
     {
         this.SendingTime = message.SendingTime;
     }
     this.ReceivingTime = message.ReceivingTime.Value;
 }
Beispiel #2
0
        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;
        }
Beispiel #3
0
        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;
                default:
                    return false;
            }

            return true;
        }
Beispiel #4
0
 void RaiseCurrencyInfo(FxMessage message)
 {
     var eh = this.CurrencyInfo;
     if (eh != null)
     {
         var e = new CurrencyInfoEventArgs(message);
         eh(this, e);
     }
 }
Beispiel #5
0
        internal override bool ProcessMessage(FxMessage message)
        {
            if (base.ProcessMessage(message))
                return true;
            switch (message.Type)
            {
                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;
        }
Beispiel #6
0
 internal SessionInfoEventArgs(FxMessage message) : base(message)
 {
     this.Information = message.SessionInfo();
 }
Beispiel #7
0
        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);
            }
        }
Beispiel #8
0
 void RaiseTradeTransactionReport(FxMessage message)
 {
     var eh = this.TradeTransactionReport;
     if (eh != null)
     {
         var e = new TradeTransactionReportEventArgs(message);
         eh(this, e);
     }
 }
Beispiel #9
0
 void RaiseAccountInfo(FxMessage message)
 {
     var eh = this.AccountInfo;
     if (eh != null)
     {
         var e = new AccountInfoEventArgs(message);
         eh(this, e);
     }
 }
Beispiel #10
0
        public bool GetNextMessage(out FxMessage message)
        {
            this.VerifyInitialized();

            return(Native.Client.GetNextMessage(this.handle, out message));
        }
 internal unsafe TradeTransactionReportEventArgs(FxMessage message)
 {
     this.Report = message.TradeTransactionReport();
 }
Beispiel #12
0
 internal unsafe SymbolInfoEventArgs(FxMessage message, string usedProtocolVersion)
 {
     var protocolVersion = new FixProtocolVersion(usedProtocolVersion);
     this.Information = message.Symbols(protocolVersion);
 }
Beispiel #13
0
 internal TickEventArgs(FxMessage message)
     : base(message)
 {
     this.Tick = message.Quote();
 }
Beispiel #14
0
 void RaiseCacheUpdated(FxMessage message)
 {
     var eh = this.CacheInitialized;
     if (eh != null)
     {
         var e = new CacheEventArgs();
         eh(this, e);
     }
 }
Beispiel #15
0
 void RaiseSessionInfo(FxMessage message)
 {
     var eh = this.SessionInfo;
     if (eh != null)
     {
         var e = new SessionInfoEventArgs(message);
         eh(this, e);
     }
 }
Beispiel #16
0
 void RaiseLogout(FxMessage message)
 {
     var eh = this.Logout;
     if (eh != null)
     {
         var e = new LogoutEventArgs(message);
         eh(this, e);
     }
 }
Beispiel #17
0
        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;
        }
Beispiel #18
0
        public void DispatchMessage(FxMessage message)
        {
            this.VerifyInitialized();

            Native.Client.DispatchMessage(this.handle, message);
        }
Beispiel #19
0
 void RaiseExecutionReport(FxMessage message)
 {
     var eh = this.ExecutionReport;
     if (eh != null)
     {
         var e = new ExecutionReportEventArgs (message);
         eh(this, e);
     }
 }
Beispiel #20
0
 internal unsafe CurrencyInfoEventArgs(FxMessage message)
 {
     this.Information = message.Currencies();
 }
Beispiel #21
0
 void RaisePositionReport(FxMessage message)
 {
     var eh = this.PositionReport;
     if (eh != null)
     {
         var e = new PositionReportEventArgs(message);
         eh(this, e);
     }
 }
Beispiel #22
0
 internal unsafe LogonEventArgs(FxMessage message)
     : base(message)
 {
     this.ProtocolVersion = message.ProtocolVersion();
 }
Beispiel #23
0
 internal unsafe ExecutionReportEventArgs(FxMessage message)
 {
     this.Report = message.ExecutionReport();
 }
Beispiel #24
0
 internal unsafe PositionReportEventArgs(FxMessage message)
 {
     this.Report = message.Position();
 }
Beispiel #25
0
 internal unsafe AccountInfoEventArgs(FxMessage message)
 {
     this.Information = message.AccountInfo();
 }
Beispiel #26
0
        public bool GetNextMessage(out FxMessage message)
        {
            this.VerifyInitialized();

            return Native.Client.GetNextMessage(this.handle, out message);
        }
Beispiel #27
0
 void RaiseTick(FxMessage message)
 {
     var eh = this.Tick;
     if (eh != null)
     {
         var e = new TickEventArgs(message);
         eh(this, e);
     }
 }
Beispiel #28
0
        public void DispatchMessage(FxMessage message)
        {
            this.VerifyInitialized();

            Native.Client.DispatchMessage(this.handle, message);
        }
Beispiel #29
0
 void RaiseSymbolInfo(FxMessage message)
 {
     var eh = this.SymbolInfo;
     if (eh != null)
     {
         var e = new SymbolInfoEventArgs(message, this.UsedProtocolVersion);
         eh(this, e);
     }
 }
Beispiel #30
0
        void SafeProcessMessage(FxMessage message)
        {
#if !DEBUG
            try
            {
#endif
                this.ProcessMessage(message);
#if !DEBUG
            }
            catch
            {
            }
#endif
            this.handle.DispatchMessage(message);
        }