当前位置: 首页>>代码示例>>C#>>正文


C# StructureValueCollection.SetArray方法代码示例

本文整理汇总了C#中Blamite.Flexibility.StructureValueCollection.SetArray方法的典型用法代码示例。如果您正苦于以下问题:C# StructureValueCollection.SetArray方法的具体用法?C# StructureValueCollection.SetArray怎么用?C# StructureValueCollection.SetArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Blamite.Flexibility.StructureValueCollection的用法示例。


在下文中一共展示了StructureValueCollection.SetArray方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Serialize

        /// <summary>
        ///     Serializes the language data into a StructureValueCollection.
        /// </summary>
        /// <returns>The StructureValueCollection that was created from the language table.</returns>
        public StructureValueCollection Serialize()
        {
            var languageSet = new StructureValueCollection[Languages.Count];
            for (int i = 0; i < Languages.Count; i++)
                languageSet[i] = Languages[i].Serialize();

            var result = new StructureValueCollection();
            result.SetArray("languages", languageSet);
            return result;
        }
开发者ID:ChadSki,项目名称:Assembly,代码行数:14,代码来源:ThirdGenLanguageGlobals.cs

示例2: SaveChanges

        /// <summary>
        ///     Saves changes made to the string list.
        /// </summary>
        /// <param name="writer">The stream to write to.</param>
        public void SaveChanges(IWriter writer)
        {
            var values = new StructureValueCollection();
            StructureValueCollection[] rangeValues = Ranges.Select(r => r.Serialize()).ToArray();
            values.SetArray("language ranges", rangeValues);

            writer.SeekTo(Tag.MetaLocation.AsOffset());
            StructureWriter.WriteStructure(values, _layout, writer);
        }
开发者ID:ChadSki,项目名称:Assembly,代码行数:13,代码来源:ThirdGenMultilingualStringList.cs

示例3: 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;
        }
开发者ID:ChadSki,项目名称:Assembly,代码行数:77,代码来源:ThirdGenHeader.cs

示例4: 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)
        {
            StructureValueCollection values = new StructureValueCollection();

            values.SetInteger("file size", (uint)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());

            if (_originalRawTableOffset != 0)
            {
                if (RawTable != null)
                    values.SetInteger("raw table offset", (uint)RawTable.Offset);

                if (localeArea != null)
                {
                    // I really don't know what these next two values are supposed to mean...anyone got anything?
                    values.SetInteger("eof index offset", localeArea.OffsetToPointer((int)FileSize)); // Reach, H4
                    values.SetInteger("eof index offset plus string data size", localeArea.OffsetToPointer((int)(FileSize + StringArea.Size))); // H3
                }
            }
            else
            {
                values.SetInteger("meta offset", (uint)MetaArea.Offset);
            }

            if (RawTable != null)
                values.SetInteger("raw table size", (uint)RawTable.Size);

            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", (uint)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("string offset magic", StringArea.BasePointer);
            }

            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);
                values.SetInteger("locale offset magic", (uint)-localeArea.PointerMask);
            }

            if (UnknownTableLocation != null)
            {
                values.SetInteger("unknown table count", (uint)UnknownCount);
                values.SetInteger("unknown table offset", UnknownTableLocation.AsPointer());
            }
            return values;
        }
开发者ID:iBotPeaches,项目名称:Assembly,代码行数:89,代码来源:ThirdGenHeader.cs


注:本文中的Blamite.Flexibility.StructureValueCollection.SetArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。