예제 #1
0
        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);
        }
예제 #2
0
파일: DataTrade.cs 프로젝트: hombrevrc/FDK
        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);
            }
        }