示例#1
0
 /// <inheritdoc />
 public async Task<byte[]> GetImageAsync(IRenderable file, string imageFormat, CancellationToken cancellationToken)
 {
     var request = new RenderRequest
     {
         FileId = file.FileId,
         FileSignature = file.FileSignature,
         ImageFormat = imageFormat
     };
     var response = await this.serviceClient.SendAsync<byte[]>(request, cancellationToken).ConfigureAwait(false);
     return response.Content;
 }
示例#2
0
        /// <inheritdoc />
        public async Task <byte[]> GetImageAsync(IRenderable file, string imageFormat, CancellationToken cancellationToken)
        {
            var request = new RenderRequest
            {
                FileId        = file.FileId,
                FileSignature = file.FileSignature,
                ImageFormat   = imageFormat
            };
            var response = await this.serviceClient.SendAsync <byte[]>(request, cancellationToken).ConfigureAwait(false);

            return(response.Content);
        }
示例#3
0
 /// <inheritdoc />
 public Task<byte[]> GetImageAsync(IRenderable file, string imageFormat, CancellationToken cancellationToken)
 {
     var request = new RenderRequest
     {
         FileId = file.FileId,
         FileSignature = file.FileSignature,
         ImageFormat = imageFormat
     };
     return this.serviceClient.SendAsync<byte[]>(request, cancellationToken).ContinueWith(
         task =>
         {
             var response = task.Result;
             return response.Content;
         },
     cancellationToken);
 }
示例#4
0
        /// <inheritdoc />
        byte[] IRenderService.GetImage(IRenderable file, string imageFormat)
        {
            var request = new RenderRequest
            {
                FileId = file.FileId,
                FileSignature = file.FileSignature,
                ImageFormat = imageFormat
            };
            var response = this.serviceClient.Send<byte[]>(request);
            if (response.Content == null)
            {
                return null;
            }

            return response.Content;
        }
示例#5
0
        /// <inheritdoc />
        byte[] IRenderService.GetImage(IRenderable file, string imageFormat)
        {
            var request = new RenderRequest
            {
                FileId        = file.FileId,
                FileSignature = file.FileSignature,
                ImageFormat   = imageFormat
            };
            var response = this.serviceClient.Send <byte[]>(request);

            if (response.Content == null)
            {
                return(null);
            }

            return(response.Content);
        }
示例#6
0
        /// <inheritdoc />
        public Task <byte[]> GetImageAsync(IRenderable file, string imageFormat, CancellationToken cancellationToken)
        {
            var request = new RenderRequest
            {
                FileId        = file.FileId,
                FileSignature = file.FileSignature,
                ImageFormat   = imageFormat
            };

            return(this.serviceClient.SendAsync <byte[]>(request, cancellationToken).ContinueWith(
                       task =>
            {
                var response = task.Result;
                return response.Content;
            },
                       cancellationToken));
        }