Beispiel #1
0
        protected override void ReadValue(PsdReader reader, object userData, out LinkedLayer value)
        {
            reader.ValidateSignature("liFD");
            int version = reader.ReadInt32();

            Guid        id         = new Guid(reader.ReadPascalString(1));
            string      name       = reader.ReadString();
            string      type       = reader.ReadType();
            string      creator    = reader.ReadType();
            long        length     = reader.ReadInt64();
            IProperties properties = reader.ReadBoolean() == true ? new DescriptorStructure(reader) : null;

            bool isDocument = this.IsDocument(reader);
            LinkedDocumentReader           documentReader   = null;
            LinkedDocumnetFileHeaderReader fileHeaderReader = null;

            if (length > 0 && isDocument == true)
            {
                long position = reader.Position;
                documentReader   = new LinkedDocumentReader(reader, length);
                reader.Position  = position;
                fileHeaderReader = new LinkedDocumnetFileHeaderReader(reader, length);
            }

            value = new LinkedLayer(name, id, documentReader, fileHeaderReader);
        }
Beispiel #2
0
        private long ReadLength(PsdReader reader, string resourceId)
        {
            long length = 0;

            if (doubleTypeKeys.Contains(resourceId) && reader.Version == 2)
            {
                length = reader.ReadInt64();
            }
            else if (reader.Version == 2)
            {
                length = reader.ReadInt64();
            }
            else
            {
                length = reader.ReadInt32();
            }

            return((length + 3) & (~3));
        }
        private long ReadLength(PsdReader reader, string resourceID)
        {
            long length = 0;
            if (doubleTypeKeys.Contains(resourceID) && reader.Version == 2)
            {
                length = reader.ReadInt64();
            }
            else
            {
                length = reader.ReadInt32();
            }

            return (length + 3) & (~3);
        }
Beispiel #4
0
        protected override void ReadData(PsdReader reader, object userData)
        {
            reader.ValidateSignature("liFE");

            int version = reader.ReadInt32();

            Guid   id      = new Guid(reader.ReadPascalString(1));
            string name    = reader.ReadString();
            string type    = reader.ReadType();
            string creator = reader.ReadType();

            long        length      = reader.ReadInt64();
            IProperties properties  = reader.ReadBoolean() == true ? new StructureDescriptor(reader).Items : null;
            Uri         absoluteUri = this.ReadAboluteUri(reader);

            EmbeddedLayer = new EmbeddedLayer(id, reader.Resolver, absoluteUri);
        }
        protected override void ReadValue(PsdReader reader, Object userData, out EmbeddedLayer value)
        {
            reader.ValidateSignature("liFE");

            Int32 version = reader.ReadInt32();

            Guid   id      = new Guid(reader.ReadPascalString(1));
            String name    = reader.ReadString();
            String type    = reader.ReadType();
            String creator = reader.ReadType();

            Int64       length      = reader.ReadInt64();
            IProperties properties  = reader.ReadBoolean() == true ? new DescriptorStructure(reader) : null;
            Uri         absoluteUri = this.ReadAboluteUri(reader);

            value = new EmbeddedLayer(id, reader.Resolver, absoluteUri);
        }
Beispiel #6
0
 protected override long OnLengthGet(PsdReader reader)
 {
     return((reader.ReadInt64() + 3) & (~3));
 }