Beispiel #1
0
        protected override void ReadData(PsdReader reader, object userData)
        {
            var resources = new List <IResourceBlock>();

            while (reader.Position < this.EndPosition)
            {
                reader.ValidateSignature(true);
                string resourceID = reader.ReadType();
                long   length     = this.ReadLength(reader, resourceID);

                var    resourceReader = ReaderCollector.CreateReader(resourceID, reader, length);
                string resourceName   = ReaderCollector.GetDisplayName(resourceID);

                resources.Add(resourceReader);
            }

            Resources = resources.ToArray();
        }
Beispiel #2
0
        protected override void ReadValue(PsdReader reader, object userData, out IProperties value)
        {
            Properties props = new Properties();

            while (reader.Position < this.EndPosition)
            {
                reader.ValidateSignature(true);
                string resourceID = reader.ReadType();
                long   length     = this.ReadLength(reader, resourceID);

                ResourceReaderBase resourceReader = ReaderCollector.CreateReader(resourceID, reader, length);
                string             resourceName   = ReaderCollector.GetDisplayName(resourceID);

                props[resourceName] = resourceReader;
            }

            value = props;
        }
        protected override void ReadValue(PsdReader reader, object userData, out IProperties value)
        {
            Properties props = new Properties();

            while (reader.Position < this.EndPosition)
            {
                reader.ValidateSignature();

                string resourceID = reader.ReadInt16().ToString();
                string name       = reader.ReadPascalString(2);
                long   length     = reader.ReadInt32();
                length += (length % 2);

                ResourceReaderBase resourceReader = ReaderCollector.CreateReader(resourceID, reader, length);
                string             resourceName   = ReaderCollector.GetDisplayName(resourceID);

                props[resourceName] = resourceReader;
            }

            value = props;
        }