Ejemplo n.º 1
0
        /// <summary>
        /// Raises the <see cref="DataParsed"/> event.
        /// </summary>
        /// <param name="output">The object that was deserialized from binary image.</param>
        protected virtual void OnDataParsed(TOutputType output)
        {
            if ((object)DataParsed != null)
            {
                // Get a reusable event args object to publish output
                EventArgs <TOutputType> outputArgs = FastObjectFactory <EventArgs <TOutputType> > .CreateObjectFunction();

                outputArgs.Argument = output;

                if (output.AllowQueuedPublication && !OptimizationOptions.DisableAsyncQueueInProtocolParsing)
                {
                    // Queue-up parsed output for publication
                    m_outputQueue.Enqueue(outputArgs);
                }
                else
                {
                    // Publish parsed output immediately
                    DataParsed?.Invoke(this, outputArgs);
                }
            }
        }
Ejemplo n.º 2
0
 protected void OnDataParsed(DataParsedEventArgs args)
 {
     DataParsed?.Invoke(this, args);
 }