Beispiel #1
0
 void OnBalanceOperation(object sender, NotificationEventArgs<BalanceOperation> e)
 {
     lock (this.SyncRoot)
     {
         this.processor.WakeUp();
     }
 }
Beispiel #2
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 #3
0
 void RaiseNotification(NotificationEventArgs e)
 {
     var eh = this.Notify;
     if (eh != null)
     {
         eh(this, e);
     }
 }
Beispiel #4
0
 void RaiseBalanceOperationNotification(NotificationEventArgs<BalanceOperation> e)
 {
     this.RaiseNotification(e);
     var eh = this.BalanceOperation;
     if (eh != null)
     {
         eh(this, e);
     }
 }
Beispiel #5
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 #6
0
 void OnBalanceOperaiton(object sender, NotificationEventArgs<BalanceOperation> e)
 {
     Console.WriteLine("OnBalanceOperaiton(): {0}", e);
 }
Beispiel #7
0
 void OnNofity(object sender, NotificationEventArgs e)
 {
     Console.WriteLine("OnNotify(): {0}", e);
 }
Beispiel #8
0
 void OnNotify(object sender, NotificationEventArgs e)
 {
     if (ShowDebug) Console.WriteLine("{0} OnNotify(): {1}", Username, e);
 }