本文整理汇总了C#中Structure.begin方法的典型用法代码示例。如果您正苦于以下问题:C# Structure.begin方法的具体用法?C# Structure.begin怎么用?C# Structure.begin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Structure
的用法示例。
在下文中一共展示了Structure.begin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: write
public override int write(Structure dataToWrite, MOStream cDst)
{
MStreamUtils.writeCharBuffer(cDst, "<?xml version='1.0' encoding='UTF-8'?>\n");
// Start with the main structure tag containing the name
string rootString = "<" + structureTag + " " + structureNameAttribute + "='" + dataToWrite.name + "'>\n";
MStreamUtils.writeCharBuffer(cDst,rootString);
// Write out each structure member in its own tag
for (StructureIterator iterator = dataToWrite.begin(); iterator != dataToWrite.end(); iterator = iterator.next())
{
string memberString = " <" + memberTag + " " + memberNameAttribute + "='" + iterator.memberName() + "'"
+ " " + memberTypeAttribute + "='" + Member.typeName(iterator.memberType()) + "'";
if (iterator.memberLength() != 1)
{
memberString = memberString + " " + memberDimAttribute + "='" + iterator.memberLength() + "'";
}
memberString += "/>\n";
MStreamUtils.writeCharBuffer(cDst,memberString);
}
rootString = "</" + structureTag + ">";
MStreamUtils.writeCharBuffer(cDst,rootString);
return 0;
}