示例#1
0
        /// <summary>
        ///     Handlers the specified sender.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="eventArgs">The <see cref="MessageEventArgs{T}" /> instance containing the event data.</param>
        private void Handler(object sender, MessageEventArgs <T> eventArgs)
        {
            ReceivedMessages.Add(eventArgs);

            if (Filter != null)
            {
                if (Filter(eventArgs))
                {
                    MessageReceived.Set( );
                }
            }
            else
            {
                MessageReceived.Set( );
            }
        }