Ejemplo n.º 1
0
        /// <summary>
        /// Sends an event for the source object asynchronously which will be picked up on the
        /// event queue at the next synchronous event or asynchronous timer event.
        /// </summary>
        /// <param name="source">The source object.</param>
        /// <param name="event">The event to send.</param>
        /// <param name="e">The event arguments</param>
        public static void SendEventAsync <TEventArgs>(this object source, Event @event, TEventArgs e)
            where TEventArgs : EventArgs
        {
            var events = source.Get <ReceivedEventQueue>();

            events.ReceivedEvents.Enqueue(ReceivedEvent.From(source, @event, e));
        }