本文整理汇总了C#中ObjectManager.RaiseDeserializationEvent方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectManager.RaiseDeserializationEvent方法的具体用法?C# ObjectManager.RaiseDeserializationEvent怎么用?C# ObjectManager.RaiseDeserializationEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectManager
的用法示例。
在下文中一共展示了ObjectManager.RaiseDeserializationEvent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: runTest
public Boolean runTest()
{
Console.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver : " + s_strDtTmVer);
int iCountErrors = 0;
int iCountTestcases = 0;
String strLoc = "Loc_000oo";
ObjectManager manager;
ISurrogateSelector selector = null;
StreamingContext context = new StreamingContext(StreamingContextStates.All);
ClsType1 cls1;
ClsType2 cls2;
Int32 iValue;
MemberInfo[] classMembers1;
MemberInfo[] classMembers2;
try {
strLoc = "Loc_734rgt";
iCountTestcases++;
cls1 = new ClsType1();
cls2 = new ClsType2();
iValue = 10;
classMembers1 = FormatterServices.GetSerializableMembers(typeof(ClsType1), context);
classMembers2 = FormatterServices.GetSerializableMembers(typeof(ClsType2), context);
manager = new ObjectManager(selector, context);
manager.RecordFixup(2, classMembers2[0], 3);
manager.RecordFixup(1, classMembers1[0], 2);
manager.RegisterObject(cls1, 1);
manager.RegisterObject(cls2, 2);
manager.RegisterObject(iValue, 3);
manager.DoFixups();
if(cls1.ClsTp2.I != 10){
iCountErrors++;
Console.WriteLine("Err_374sdg! Change of behavioue, unexpected value returned, " + cls1.ClsTp2.I);
}
manager.RaiseDeserializationEvent();
if(cls1.ClsTp2.I != 15){
iCountErrors++;
Console.WriteLine("Err_987345sg! Change of behavioue, unexpected value returned, " + cls1.ClsTp2.I);
}
} catch (Exception exc_general ) {
++iCountErrors;
Console.WriteLine (s_strTFAbbrev + " : Error Err_8888yyy! strLoc=="+ strLoc +", exc_general==\n"+exc_general.StackTrace);
}
if ( iCountErrors == 0 )
{
Console.WriteLine( "paSs. "+s_strTFPath +" "+s_strTFName+" ,iCountTestcases=="+iCountTestcases);
return true;
}
else
{
Console.WriteLine("FAiL! "+s_strTFPath+" "+s_strTFName+" ,iCountErrors=="+iCountErrors+" , BugNums?: "+s_strActiveBugNums );
return false;
}
}