using System; using System.Collections.Generic; using System.Text; using System.Runtime.Serialization; using System.Diagnostics; namespace BNSharp { /// /// Specifies the contract for chat events that involve another user and communication. /// /// The object that raised the event. /// The event arguments. public delegate void ChatMessageEventHandler(object sender, ChatMessageEventArgs e); /// /// Represents the event information associated with a chat event with a given user and communication. /// [DataContract] [DebuggerDisplay("Type={EventType}, User={Username}, \"{Text}\"")] public class ChatMessageEventArgs : ChatEventArgs { #region fields [DataMember(Name = "Flags")] private UserFlags m_flags; [DataMember(Name = "Username")] private string m_un; [DataMember(Name = "Text")] private string m_txt; #endregion /// /// Creates a new instance of ChatMessageEventArgs with the given parameters. /// /// The type of event. /// The other user's flags. /// The primarily involved user. /// The message. public ChatMessageEventArgs(ChatEventType eventType, UserFlags flags, string username, string text) : base(eventType) { m_flags = flags; m_un = username; m_txt = text; } /// /// Gets the flags of the user. /// public UserFlags Flags { get { return m_flags; } } /// /// Gets the name of the user who communicated. /// public string Username { get { return m_un; } } /// /// Gets the message. /// public string Text { get { return m_txt; } } } }