本文整理汇总了C#中Core.ThrowIfNull方法的典型用法代码示例。如果您正苦于以下问题:C# Core.ThrowIfNull方法的具体用法?C# Core.ThrowIfNull怎么用?C# Core.ThrowIfNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Core
的用法示例。
在下文中一共展示了Core.ThrowIfNull方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Message
/// <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");
}
示例2: Presence
/// <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;
}