/// <summary> /// <para>Begins an asynchronous send to the get thumbnail route.</para> /// </summary> /// <param name="path">The path to the image file you want to thumbnail.</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="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 BeginGetThumbnail(string path, ThumbnailFormat format = null, ThumbnailSize size = null, sys.AsyncCallback callback = null, object callbackState = null) { var thumbnailArg = new ThumbnailArg(path, format, size); return this.BeginGetThumbnail(thumbnailArg, callback, callbackState); }
/// <summary> /// <para>Begins an asynchronous send to the get thumbnail route.</para> /// </summary> /// <param name="thumbnailArg">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 BeginGetThumbnail(ThumbnailArg thumbnailArg, sys.AsyncCallback callback, object state = null) { var task = this.GetThumbnailAsync(thumbnailArg); return enc.Util.ToApm(task, callback, state); }
/// <summary> /// <para>Get a thumbnail for an image.</para> /// <para>This method currently supports files with the following file extensions: jpg, /// jpeg, png, tiff, tif, gif and bmp. Photos that are larger than 20MB in size won't /// be converted to a thumbnail.</para> /// </summary> /// <param name="path">The path to the image file you want to thumbnail.</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> /// <returns>The task that represents the asynchronous send operation. The TResult /// parameter contains the response from the server.</returns> /// <exception cref="Dropbox.Api.ApiException{ThumbnailError}">Thrown if there is an /// error processing the request; This will contain a <see /// cref="ThumbnailError"/>.</exception> public t.Task<enc.IDownloadResponse<FileMetadata>> GetThumbnailAsync(string path, ThumbnailFormat format = null, ThumbnailSize size = null) { var thumbnailArg = new ThumbnailArg(path, format, size); return this.GetThumbnailAsync(thumbnailArg); }
/// <summary> /// <para>Get a thumbnail for an image.</para> /// <para>This method currently supports files with the following file extensions: jpg, /// jpeg, png, tiff, tif, gif and bmp. Photos that are larger than 20MB in size won't /// be converted to a thumbnail.</para> /// </summary> /// <param name="thumbnailArg">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{ThumbnailError}">Thrown if there is an /// error processing the request; This will contain a <see /// cref="ThumbnailError"/>.</exception> public t.Task<enc.IDownloadResponse<FileMetadata>> GetThumbnailAsync(ThumbnailArg thumbnailArg) { return this.Transport.SendDownloadRequestAsync<ThumbnailArg, FileMetadata, ThumbnailError>(thumbnailArg, "content", "/files/get_thumbnail", ThumbnailArg.Encoder, FileMetadata.Decoder, ThumbnailError.Decoder); }