Exemplo n.º 1
0
        /// <summary>
        /// Populate the file group list from header data
        /// </summary>
        public bool GetFileGroups()
        {
            int count = 0;

            this.FileGroups = new FileGroup[Constants.MAX_FILE_GROUP_COUNT];

            for (int i = 0; i < Constants.MAX_FILE_GROUP_COUNT; i++)
            {
                if (this.Descriptor.FileGroupOffsets[i] <= 0)
                {
                    continue;
                }

                var list = new OffsetList(this.Descriptor.FileGroupOffsets[i]);
                while (list.NextOffset > 0)
                {
                    int p = GetDataOffset(list.NextOffset);
                    list = OffsetList.Create(this.Data, p);
                    this.FileGroups[count++] = FileGroup.Create(this, list.DescriptorOffset);
                }
            }

            this.FileGroupCount = count;
            return(true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Populate the component list from header data
        /// </summary>
        public bool GetComponents()
        {
            int count = 0;

            this.Components = new Component[Constants.MAX_COMPONENT_COUNT];

            for (int i = 0; i < Constants.MAX_COMPONENT_COUNT; i++)
            {
                if (this.Descriptor.ComponentOffsets[i] <= 0)
                {
                    continue;
                }

                var list = new OffsetList(this.Descriptor.ComponentOffsets[i]);
                while (list.NextOffset > 0)
                {
                    int p = GetDataOffset(list.NextOffset);
                    list = OffsetList.Create(this.Data, p);
                    this.Components[count++] = Component.Create(this, list.DescriptorOffset);
                }
            }

            this.ComponentCount = count;
            return(true);
        }