Exemple #1
0
        public ListStructure(PsdBinaryReader reader)
        {
            int number = reader.ReadInt32();

            List = new Descriptor[number];

            for (int i = 0; i < number; ++i)
            {
                List[i] = DescriptorFactory.Load(reader);
            }
        }
        public DescriptorStructure(PsdBinaryReader reader, string key = null)
        {
            _key        = key;
            ClassIDName = reader.ReadUnicodeString();
            var length = reader.ReadInt32();

            ClassID = reader.ReadAsciiChars(length == 0 ? 4 : length);

            var itemCount = reader.ReadInt32();

            Descriptor = new Dictionary <string, Descriptor> ();
            for (int i = 0; i < itemCount; i++)
            {
                length = reader.ReadInt32();
                string itemName = reader.ReadAsciiChars(length == 0 ? 4 : length);

                Descriptor.Add(itemName, DescriptorFactory.Load(reader));
            }
        }