Пример #1
0
        /// <summary>
        /// <para>Get a thumbnail for a file.</para>
        /// </summary>
        /// <param name="resource">Information specifying which file to preview. This could be
        /// a path to a file, a shared link pointing to a file, or a shared link pointing to a
        /// folder, with a relative path.</param>
        /// <param name="format">The format for the thumbnail image, jpeg (default) or png. For
        /// images that are photos, jpeg should be preferred, while png is  better for
        /// screenshots and digital arts.</param>
        /// <param name="size">The size for the thumbnail image.</param>
        /// <param name="mode">How to resize and crop the image to achieve the desired
        /// size.</param>
        /// <returns>The task that represents the asynchronous send operation. The TResult
        /// parameter contains the response from the server.</returns>
        /// <exception cref="Dropbox.Api.ApiException{TError}">Thrown if there is an error
        /// processing the request; This will contain a <see
        /// cref="ThumbnailV2Error"/>.</exception>
        public t.Task <enc.IDownloadResponse <PreviewResult> > GetThumbnailV2Async(PathOrLink resource,
                                                                                   ThumbnailFormat format = null,
                                                                                   ThumbnailSize size     = null,
                                                                                   ThumbnailMode mode     = null)
        {
            var thumbnailV2Arg = new ThumbnailV2Arg(resource,
                                                    format,
                                                    size,
                                                    mode);

            return(this.GetThumbnailV2Async(thumbnailV2Arg));
        }
Пример #2
0
        /// <summary>
        /// <para>Begins an asynchronous send to the get thumbnail route.</para>
        /// </summary>
        /// <param name="resource">Information specifying which file to preview. This could be
        /// a path to a file, a shared link pointing to a file, or a shared link pointing to a
        /// folder, with a relative path.</param>
        /// <param name="format">The format for the thumbnail image, jpeg (default) or png. For
        /// images that are photos, jpeg should be preferred, while png is  better for
        /// screenshots and digital arts.</param>
        /// <param name="size">The size for the thumbnail image.</param>
        /// <param name="mode">How to resize and crop the image to achieve the desired
        /// size.</param>
        /// <param name="callback">The method to be called when the asynchronous send is
        /// completed.</param>
        /// <param name="callbackState">A user provided object that distinguished this send
        /// from other send requests.</param>
        /// <returns>An object that represents the asynchronous send request.</returns>
        public sys.IAsyncResult BeginGetThumbnailV2(PathOrLink resource,
                                                    ThumbnailFormat format     = null,
                                                    ThumbnailSize size         = null,
                                                    ThumbnailMode mode         = null,
                                                    sys.AsyncCallback callback = null,
                                                    object callbackState       = null)
        {
            var thumbnailV2Arg = new ThumbnailV2Arg(resource,
                                                    format,
                                                    size,
                                                    mode);

            return(this.BeginGetThumbnailV2(thumbnailV2Arg, callback, callbackState));
        }
Пример #3
0
        /// <summary>
        /// <para>Begins an asynchronous send to the get thumbnail route.</para>
        /// </summary>
        /// <param name="thumbnailV2Arg">The request parameters.</param>
        /// <param name="callback">The method to be called when the asynchronous send is
        /// completed.</param>
        /// <param name="state">A user provided object that distinguished this send from other
        /// send requests.</param>
        /// <returns>An object that represents the asynchronous send request.</returns>
        public sys.IAsyncResult BeginGetThumbnailV2(ThumbnailV2Arg thumbnailV2Arg, sys.AsyncCallback callback, object state = null)
        {
            var task = this.GetThumbnailV2Async(thumbnailV2Arg);

            return(enc.Util.ToApm(task, callback, state));
        }
Пример #4
0
 /// <summary>
 /// <para>Get a thumbnail for a file.</para>
 /// </summary>
 /// <param name="thumbnailV2Arg">The request parameters</param>
 /// <returns>The task that represents the asynchronous send operation. The TResult
 /// parameter contains the response from the server.</returns>
 /// <exception cref="Dropbox.Api.ApiException{TError}">Thrown if there is an error
 /// processing the request; This will contain a <see
 /// cref="ThumbnailV2Error"/>.</exception>
 public t.Task <enc.IDownloadResponse <PreviewResult> > GetThumbnailV2Async(ThumbnailV2Arg thumbnailV2Arg)
 {
     return(this.Transport.SendDownloadRequestAsync <ThumbnailV2Arg, PreviewResult, ThumbnailV2Error>(thumbnailV2Arg, "content", "/files/get_thumbnail_v2", "app", global::Dropbox.Api.Files.ThumbnailV2Arg.Encoder, global::Dropbox.Api.Files.PreviewResult.Decoder, global::Dropbox.Api.Files.ThumbnailV2Error.Decoder));
 }