本文整理匯總了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);
}