/// <summary> /// Initializes a new instance of the Message class from the specified /// instance. /// </summary> /// <param name="message">An instance of the Core.Message class to /// initialize this instance with.</param> /// <exception cref="ArgumentNullException">The message parameter is null.</exception> /// <exception cref="ArgumentException">The 'type' attribute of /// the specified message stanza is invalid.</exception> internal Message(Core.Message message) { message.ThrowIfNull("message"); type = ParseType(message.Data.GetAttribute("type")); element = message.Data; AlternateSubjects = new XmlDictionary(element, "subject", "xml:lang"); AlternateBodies = new XmlDictionary(element, "body", "xml:lang"); }
/// <summary> /// Initializes a new instance of the Presence class from the specified /// instance. /// </summary> /// <param name="presence">An instance of the Core.Presence class to /// initialize this instance with.</param> /// <exception cref="ArgumentNullException">The presence parameter is null.</exception> /// <exception cref="ArgumentException">The 'type' attribute of the /// specified presence stanza is invalid.</exception> public Presence(Core.Presence presence) { presence.ThrowIfNull("presence"); type = ParseType(presence.Data.GetAttribute("type")); element = presence.Data; }