本文整理汇总了C#中Blamite.Serialization.StructureValueCollection.SetString方法的典型用法代码示例。如果您正苦于以下问题:C# StructureValueCollection.SetString方法的具体用法?C# StructureValueCollection.SetString怎么用?C# StructureValueCollection.SetString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Blamite.Serialization.StructureValueCollection
的用法示例。
在下文中一共展示了StructureValueCollection.SetString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Serialize
public StructureValueCollection Serialize()
{
var result = new StructureValueCollection();
result.SetInteger("file size", FileSize);
result.SetInteger("meta offset", (uint) MetaArea.Offset);
result.SetInteger("meta size", (uint) MetaArea.Size);
result.SetInteger("meta offset mask", MetaArea.BasePointer);
result.SetInteger("type", (uint) Type);
result.SetInteger("string table count", (uint) StringIDCount);
result.SetInteger("string table size", (uint) StringIDData.Size);
result.SetInteger("string index table offset", (uint) StringIDIndexTable.Offset);
result.SetInteger("string table offset", (uint) StringIDData.Offset);
result.SetString("internal name", InternalName);
result.SetString("scenario name", ScenarioName);
result.SetInteger("file table count", (uint) FileNameCount);
result.SetInteger("file table offset", (uint) FileNameData.Offset);
result.SetInteger("file table size", (uint) FileNameData.Size);
result.SetInteger("file index table offset", (uint) FileNameIndexTable.Offset);
result.SetInteger("raw table offset", (uint) RawTable.Offset);
result.SetInteger("raw table size", (uint) RawTable.Size);
result.SetInteger("checksum", Checksum);
return result;
}
示例2: Serialize
/// <summary>
/// Serializes the header's values, storing them into a StructureValueCollection.
/// </summary>
/// <param name="localeArea">The locale area of the cache file. Can be null.</param>
/// <param name="localePointerMask">The value to add to locale pointers to translate them to file offsets.</param>
/// <returns>The resulting StructureValueCollection.</returns>
public StructureValueCollection Serialize(FileSegmentGroup localeArea)
{
var values = new StructureValueCollection();
values.SetInteger("file size", FileSize);
values.SetInteger("type", (uint) Type);
values.SetString("internal name", InternalName);
values.SetString("scenario name", ScenarioName);
values.SetInteger("xdk version", (uint) XDKVersion);
AdjustPartitions();
values.SetArray("partitions", SerializePartitions());
RebuildInteropData(localeArea);
values.SetArray("offset masks", SectionOffsetMasks.Select(m =>
{
var result = new StructureValueCollection();
result.SetInteger("mask", m);
return result;
}).ToArray());
values.SetArray("sections", Sections.Select(s => s.Serialize()).ToArray());
values.SetInteger("tag buffer offset", Sections[(int) ThirdGenInteropSectionType.Tag].VirtualAddress);
if (MetaArea != null)
{
values.SetInteger("virtual base address", MetaArea.BasePointer);
values.SetInteger("index header address", IndexHeaderLocation.AsPointer());
values.SetInteger("virtual size", (uint) MetaArea.Size);
}
if (StringBlockLocation != null)
values.SetInteger("string block offset", StringBlockLocation.AsPointer());
values.SetInteger("string table count", (uint) StringIDCount);
if (StringIDData != null)
{
values.SetInteger("string table size", (uint) StringIDData.Size);
values.SetInteger("string table offset", StringIDDataLocation.AsPointer());
}
if (StringIDIndexTableLocation != null)
values.SetInteger("string index table offset", StringIDIndexTableLocation.AsPointer());
if (StringArea != null)
values.SetInteger("string data size", (uint) StringArea.Size);
values.SetInteger("file table count", (uint) FileNameCount);
if (FileNameData != null)
{
values.SetInteger("file table offset", FileNameDataLocation.AsPointer());
values.SetInteger("file table size", (uint) FileNameData.Size);
}
if (FileNameIndexTableLocation != null)
values.SetInteger("file index table offset", FileNameIndexTableLocation.AsPointer());
if (localeArea != null)
{
values.SetInteger("locale data index offset", localeArea.BasePointer);
values.SetInteger("locale data size", (uint) localeArea.Size);
}
if (UnknownTableLocation != null)
{
values.SetInteger("unknown table count", (uint) UnknownCount);
values.SetInteger("unknown table offset", UnknownTableLocation.AsPointer());
}
return values;
}