/// <summary> /// Initializes a new instance of the <see cref="Message" /> class. /// </summary> /// <param name="channel">The channel.</param> /// <param name="text">The text.</param> /// <param name="subtype">The message subtype.</param> /// <param name="user">The user.</param> /// <param name="hidden">if set to <c>true</c> the message is hidden.</param> /// <exception cref="System.ArgumentNullException">channel</exception> public Message(string channel, string text, MessageSubtypes subtype = MessageSubtypes.Message, string user = null, bool hidden = false, IEnumerable<Attachment> attachments = null) { if (string.IsNullOrEmpty(channel)) throw new ArgumentNullException("channel"); Channel = channel; Text = text ?? string.Empty; User = user; Subtype = subtype; Hidden = hidden; Attachments = new ReadOnlyCollection<Attachment>((attachments ?? Enumerable.Empty<Attachment>()).ToList()); }
private void OnAddSubtype(MessageTypeTreeModel mttm = null) { if (null == MessageSubtypes) { MessageSubtypes = new MessageTypeCollection(); } MessageSubtypes.Add(new MessageTypeTreeModel { SubtypeName = "New Subtype", }); OnPropertyChanged("MessageSubtypes"); }
/// <summary> /// Initializes a new instance of the <see cref="Message" /> class. /// </summary> /// <param name="channel">The channel.</param> /// <param name="text">The text.</param> /// <param name="subtype">The message subtype.</param> /// <param name="user">The user.</param> /// <param name="hidden">if set to <c>true</c> the message is hidden.</param> /// <exception cref="System.ArgumentNullException">channel</exception> public Message(string channel, string text, MessageSubtypes subtype = MessageSubtypes.Message, string user = null, bool hidden = false, IEnumerable <Attachment> attachments = null) { if (string.IsNullOrEmpty(channel)) { throw new ArgumentNullException("channel"); } Channel = channel; Text = text ?? string.Empty; User = user; Subtype = subtype; Hidden = hidden; Attachments = new ReadOnlyCollection <Attachment>((attachments ?? Enumerable.Empty <Attachment>()).ToList()); }