本文整理汇总了C#中IPluginVisitor.VisitTagReference方法的典型用法代码示例。如果您正苦于以下问题:C# IPluginVisitor.VisitTagReference方法的具体用法?C# IPluginVisitor.VisitTagReference怎么用?C# IPluginVisitor.VisitTagReference使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPluginVisitor
的用法示例。
在下文中一共展示了IPluginVisitor.VisitTagReference方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadTagRef
private static void ReadTagRef(XmlReader reader, string name, uint offset, bool visible, IPluginVisitor visitor, uint pluginLine)
{
var showJumpTo = true;
var withClass = true;
if (reader.MoveToAttribute("showJumpTo"))
showJumpTo = ParseBool(reader.Value);
if (reader.MoveToAttribute("withClass"))
withClass = ParseBool(reader.Value);
visitor.VisitTagReference(name, offset, visible, withClass, showJumpTo, pluginLine);
}
示例2: WritePlugin
private void WritePlugin(MetaMap map, int size, IPluginVisitor writer)
{
for (int offset = 0; offset < size; offset += 4)
{
MetaValueGuess guess = map.GetGuess(offset);
if (guess != null)
{
switch (guess.Type)
{
case MetaValueType.DataReference:
if (offset <= size - 0x14)
{
writer.VisitDataReference("Unknown", (uint) offset, "bytes", false, 4, 0);
offset += 0x10;
continue;
}
break;
case MetaValueType.TagReference:
if (offset <= size - 0x10)
{
writer.VisitTagReference("Unknown", (uint) offset, false, true, true, 0);
offset += 0xC;
continue;
}
break;
case MetaValueType.Reflexive:
if (offset <= size - 0xC)
{
MetaMap subMap = map.GetSubMap(offset);
if (subMap != null)
{
int subMapSize = subMap.GetBestSizeEstimate();
writer.EnterReflexive("Unknown", (uint) offset, false, (uint)subMapSize, 4, 0);
WritePlugin(subMap, subMapSize, writer);
writer.LeaveReflexive();
offset += 0x8;
continue;
}
}
break;
}
}
// Just write an unknown value depending upon how much space we have left
if (offset <= size - 4)
writer.VisitUndefined("Unknown", (uint) offset, false, 0);
else if (offset <= size - 2)
writer.VisitInt16("Unknown", (uint) offset, false, 0);
else
writer.VisitInt8("Unknown", (uint) offset, false, 0);
}
}