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