/// <summary>
        /// Creates and output event from a source event.
        /// </summary>
        /// <param name="sourceEvent">The source event.</param>
        /// <returns></returns>
        public static StreamOutputEvent <TPayload> Create(PointEvent <TPayload> sourceEvent)
        {
            var outputEvent = new StreamOutputEvent <TPayload>()
            {
                StartTime  = sourceEvent.StartTime,
                EventKind  = sourceEvent.EventKind,
                EventShape = EventShape.Point
            };

            if (sourceEvent.EventKind == EventKind.Insert)
            {
                outputEvent.Payload = sourceEvent.Payload;
            }
            return(outputEvent);
        }
        /// <summary>
        /// Creates and output event from a source event.
        /// </summary>
        /// <param name="sourceEvent">The source event.</param>
        /// <returns></returns>
        public static StreamOutputEvent <TPayload> Create(EdgeEvent <TPayload> sourceEvent)
        {
            var outputEvent = new StreamOutputEvent <TPayload>()
            {
                StartTime  = sourceEvent.StartTime,
                EventKind  = sourceEvent.EventKind,
                EventShape = EventShape.Edge
            };

            if (sourceEvent.EventKind == EventKind.Insert)
            {
                outputEvent.Payload  = sourceEvent.Payload;
                outputEvent.EdgeType = sourceEvent.EdgeType;
                if (sourceEvent.EdgeType == Microsoft.ComplexEventProcessing.EdgeType.End)
                {
                    outputEvent.EndTime = sourceEvent.EndTime;
                }
            }
            return(outputEvent);
        }
 public void OnNext(EdgeEvent <TPayloadType> value)
 {
     EventReceived(StreamOutputEvent <TPayloadType> .Create((EdgeEvent <TPayloadType>)value));
 }
 public abstract void EventReceived(StreamOutputEvent <TPayloadType> outputEvent);