本文整理汇总了C#中System.Runtime.Serialization.SerializationInfo.CheckForNotNull方法的典型用法代码示例。如果您正苦于以下问题:C# SerializationInfo.CheckForNotNull方法的具体用法?C# SerializationInfo.CheckForNotNull怎么用?C# SerializationInfo.CheckForNotNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Runtime.Serialization.SerializationInfo
的用法示例。
在下文中一共展示了SerializationInfo.CheckForNotNull方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestSuite
/// <summary>
/// Initializes the object of TestSuite class.
/// </summary>
/// <param name="info">SerializationInfo object</param>
/// <param name="context">Optional StreamingContext</param>
public TestSuite(SerializationInfo info, Nullable<StreamingContext> context = null)
{
info.CheckForNotNull(() => info);
this.serializationInfo = info;
// remove it after complete code refactoring.
// Note: constructor shouldn't be doing operations which can throw exceptions other than argument checking.
// expose a public method to initialize the object.
this.Initialize();
}
示例2: ImportObjectData
public void ImportObjectData(SerializationInfo info, Nullable<StreamingContext> context = null)
{
info.CheckForNotNull(() => info, "Serialization info should not be null.");
info.AddValue("EndPoints", EndPoints);
info.AddValue("EndPointType", EndPointType);
//info.AddValue("EndpointsForContracts", EndpointsForContracts);
info.AddValue("Guid", Guid);
info.AddValue("Tests", Tests);
info.AddValue("FunctionalTests", FunctionalTests);
info.AddValue("Wsdl", Wsdl);
info.AddValue("BaseUrl", BaseUrl);
info.AddValue("ServiceUrl", ServiceUrl);
info.AddValue("Configuration", Configuration);
info.AddValue("BindingToTest", BindingToTest);
}