public SerializableLinkedResource(LinkedResource linkedResource)
        {
            ContentId = linkedResource.ContentId;
            ContentLink = linkedResource.ContentLink;
            ContentType = new SerializableContentType(linkedResource.ContentType);
            TransferEncoding = linkedResource.TransferEncoding;

            if (linkedResource.ContentStream != null)
            {
                var bytes = new byte[linkedResource.ContentStream.Length];
                linkedResource.ContentStream.Read(bytes, 0, bytes.Length);
                ContentStream = new MemoryStream(bytes);
            }
        }
Beispiel #2
0
        public SerializableLinkedResource(LinkedResource linkedResource)
        {
            ContentId        = linkedResource.ContentId;
            ContentLink      = linkedResource.ContentLink;
            ContentType      = new SerializableContentType(linkedResource.ContentType);
            TransferEncoding = linkedResource.TransferEncoding;

            if (linkedResource.ContentStream != null)
            {
                var bytes = new byte[linkedResource.ContentStream.Length];
                linkedResource.ContentStream.Read(bytes, 0, bytes.Length);
                ContentStream = new MemoryStream(bytes);
            }
        }
        public SerializableAttachment(Attachment attachment)
        {
            ContentId = attachment.ContentId;
            ContentDisposition = new SerializableContentDisposition(attachment.ContentDisposition);
            ContentType = new SerializableContentType(attachment.ContentType);
            Name = attachment.Name;
            TransferEncoding = attachment.TransferEncoding;
            NameEncoding = attachment.NameEncoding;

            if (attachment.ContentStream != null)
            {
                byte[] bytes = new byte[attachment.ContentStream.Length];
                attachment.ContentStream.Read(bytes, 0, bytes.Length);

                ContentStream = new MemoryStream(bytes);
            }
        }
Beispiel #4
0
        public SerializableAttachment(Attachment attachment)
        {
            ContentId          = attachment.ContentId;
            ContentDisposition = new SerializableContentDisposition(attachment.ContentDisposition);
            ContentType        = new SerializableContentType(attachment.ContentType);
            Name             = attachment.Name;
            TransferEncoding = attachment.TransferEncoding;
            NameEncoding     = attachment.NameEncoding;

            if (attachment.ContentStream != null)
            {
                byte[] bytes = new byte[attachment.ContentStream.Length];
                attachment.ContentStream.Read(bytes, 0, bytes.Length);

                ContentStream = new MemoryStream(bytes);
            }
        }
Beispiel #5
0
        public SerializableAlternateView(AlternateView alternativeView)
        {
            BaseUri = alternativeView.BaseUri;
            ContentId = alternativeView.ContentId;
            ContentType = new SerializableContentType(alternativeView.ContentType);
            TransferEncoding = alternativeView.TransferEncoding;

            if (alternativeView.ContentStream != null)
            {
                byte[] bytes = new byte[alternativeView.ContentStream.Length];
                alternativeView.ContentStream.Read(bytes, 0, bytes.Length);
                ContentStream = new MemoryStream(bytes);
            }

            foreach (var lr in alternativeView.LinkedResources)
                LinkedResources.Add(new SerializableLinkedResource(lr));
        }
        public SerializableAlternateView(AlternateView alternativeView)
        {
            BaseUri = alternativeView.BaseUri;
            ContentId = alternativeView.ContentId;
            ContentType = new SerializableContentType(alternativeView.ContentType);
            TransferEncoding = alternativeView.TransferEncoding;

            if (alternativeView.ContentStream != null)
            {
                byte[] bytes = new byte[alternativeView.ContentStream.Length];
                alternativeView.ContentStream.Read(bytes, 0, bytes.Length);
                ContentStream = new MemoryStream(bytes);
            }

            foreach (var lr in alternativeView.LinkedResources)
                LinkedResources.Add(new SerializableLinkedResource(lr));
        }