Exemple #1
0
        /// <summary>
        /// Fire the new sinal event to the subscribed users
        /// </summary>
        /// <param name="signalInformation"></param>
        public void PublishNewSignal(string signalInformation)
        {
            try
            {
                if (signalInformation.Contains("___autofxtools trademirror___Alive___"))
                {
                    Logger.Debug("Heartbeat. = " + signalInformation, OType.FullName, "PublishNewSignal");
                }
                else
                {
                    Logger.Debug("New Signal Receievd from data source. Signal = " + signalInformation, OType.FullName, "PublishNewSignal");
                    _systemOrderID++;

                    ThreadPool.QueueUserWorkItem(SendSignalNotification, signalInformation);

                    signalInformation = TransformSignalInformation(signalInformation, _systemOrderID);

                    ThreadPool.QueueUserWorkItem(InsertSignalIntoDB, signalInformation);
                }

                var e = new NewSignalEventArgs {
                    SignalInformation = signalInformation
                };
                NewSignalEvent(this, e);
                Logger.Debug("New Message Published. Message = " + signalInformation, OType.FullName, "PublishNewSignal");
            }
            catch (Exception exception)
            {
                Logger.Error(exception, OType.FullName, "PublishNewSignal");
            }
        }
Exemple #2
0
 /// <summary>
 /// New Signal event handler
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void NewSignalHandler(object sender, NewSignalEventArgs e)
 {
     _callback.NewSignal(e.SignalInformation);
 }