本文整理汇总了C#中StructureType.Accept方法的典型用法代码示例。如果您正苦于以下问题:C# StructureType.Accept方法的具体用法?C# StructureType.Accept怎么用?C# StructureType.Accept使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StructureType
的用法示例。
在下文中一共展示了StructureType.Accept方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DTS_issue_113
public void DTS_issue_113()
{
// This recursive structure shoudn't blow up the stack.
var str = new StructureType("foo", 0);
str.Fields.Add(0, new Pointer(str, 4), "bar");
var sStr = str.Accept(new DataTypeSerializer());
Assert.AreEqual("struct(foo, (0, bar, ptr(struct(foo, ))))", sStr.ToString());
}
示例2: VisitStructure
public override DataType VisitStructure(StructureType str)
{
// Do not transform user-defined types
if (str.UserDefined)
return str;
if (visitedTypes.Contains(str))
return str;
visitedTypes.Add(str);
if (insideComplexType)
{
changed = true;
NestedComplexTypeExtractor nctr = new NestedComplexTypeExtractor(factory, store);
str.Accept(nctr);
return CreateEquivalenceClass(str);
}
else
{
insideComplexType = true;
return base.VisitStructure(str);
}
}
示例3: TtranNonUserStruct
public void TtranNonUserStruct()
{
var t1 = new StructureType("T1", 4, true);
var t2 = new StructureType("T2", 0, false)
{
Fields = { { 0, t1 } }
};
var ttran = new TypeTransformer(factory, store, null);
var dt = t2.Accept(ttran);
Assert.AreSame(t1, dt, "Should reduce fields at offset 0 ");
}
示例4: TtranUserStruct
public void TtranUserStruct()
{
var t1 = new StructureType("T1", 4, true);
var t2 = new StructureType("T2", 0, true)
{
Fields = { { 0, t1 } }
};
var ttran = new TypeTransformer(factory, store, null);
var dt = t2.Accept(ttran);
Assert.AreSame(t2, dt, "Should not affect user-defined types");
}