本文整理汇总了C#中ObjectManager.RecordArrayElementFixup方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectManager.RecordArrayElementFixup方法的具体用法?C# ObjectManager.RecordArrayElementFixup怎么用?C# ObjectManager.RecordArrayElementFixup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectManager
的用法示例。
在下文中一共展示了ObjectManager.RecordArrayElementFixup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: runTest
public bool 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 objmgr1 = null;
StreamingContext sc1 = new StreamingContext(StreamingContextStates.All);
ObjectIDGenerator objid1 = null;
Int64 iRootID;
Int64 iChildID;
bool fFirstTime;
String[] strArr;
String strToBeFixed;
TestArrayFixup[] arrTst1;
TestArrayFixup tst1;
Int32[] indices;
String[,] multiArr;
String anotherString;
Int64 anotherStringId;
try {
do
{
strLoc = "Loc_9457and";
strArr = new String[1];
strToBeFixed = "Hello World";
indices = new Int32[1];
indices[0] = 0;
objid1 = new ObjectIDGenerator();
iRootID = objid1.GetId(strArr, out fFirstTime);
iChildID = objid1.GetId(strToBeFixed, out fFirstTime);
objmgr1 = new ObjectManager(null, sc1);
objmgr1.RecordArrayElementFixup(iRootID, indices, iChildID);
objmgr1.RegisterObject(strArr, iRootID);
objmgr1.RegisterObject(strToBeFixed, iChildID);
iCountTestcases++;
if(!strArr[0].Equals(strToBeFixed))
{
iCountErrors++;
Console.WriteLine("Err_0452fsd! Expected value not returned, " + strArr[0] + ", expected, " + strToBeFixed);
}
objmgr1.DoFixups();
strLoc = "Loc_017ged";
iCountTestcases++;
if(!strArr[0].Equals(strToBeFixed))
{
iCountErrors++;
Console.WriteLine("Err_90453vdf! Expected value not returned, " + strArr[0] + ", expected, " + strToBeFixed);
}
multiArr = new String[5, 10];
indices = new Int32[2];
indices[0] = 1;
indices[1] = 5;
objid1 = new ObjectIDGenerator();
iRootID = objid1.GetId(multiArr, out fFirstTime);
strToBeFixed = "Hello World";
iChildID = objid1.GetId(strToBeFixed, out fFirstTime);
objmgr1 = new ObjectManager(null, sc1);
objmgr1.RecordArrayElementFixup(iRootID, indices, iChildID);
objmgr1.RegisterObject(multiArr, iRootID);
objmgr1.RegisterObject(strToBeFixed, iChildID);
iCountTestcases++;
if(!multiArr[1, 5].Equals(strToBeFixed)){
iCountErrors++;
Console.WriteLine("Err_79435sdg_! Expected value not returned, " + multiArr[1,5] + ", expected, " + strToBeFixed);
}
strLoc = "Loc_1294cd";
arrTst1 = new TestArrayFixup[10];
tst1 = new TestArrayFixup();
indices = new Int32[1];
indices[0] = 5;
objid1 = new ObjectIDGenerator();
iRootID = objid1.GetId(arrTst1, out fFirstTime);
iChildID = objid1.GetId(tst1, out fFirstTime);
objmgr1 = new ObjectManager(null, sc1);
objmgr1.RecordArrayElementFixup(iRootID, indices, iChildID);
objmgr1.RegisterObject(arrTst1, iRootID);
objmgr1.RegisterObject(tst1, iChildID);
iCountTestcases++;
if(arrTst1[5].iValue != tst1.iValue)
{
iCountErrors++;
Console.WriteLine("Err_112sx! Expected value not returned, " + arrTst1[5].iValue + ", expected, " + tst1.iValue);
}
objmgr1.DoFixups();
strLoc = "Loc_017ged";
iCountTestcases++;
if(arrTst1[5].iValue != tst1.iValue)
{
iCountErrors++;
Console.WriteLine("Err_2048cd! Expected value not returned, " + arrTst1[5].iValue + ", expected, " + tst1.iValue);
}
strLoc = "Loc_83476tsg";
iCountTestcases++;
strArr = new String[1];
strToBeFixed = "Hello World";
indices = new Int32[2];
indices[0] = 0;
indices[1] = 0;
objid1 = new ObjectIDGenerator();
//.........这里部分代码省略.........