| | | 1 | | using System; |
| | | 2 | | using Renci.SshNet.Common; |
| | | 3 | | |
| | | 4 | | namespace Renci.SshNet.Sftp |
| | | 5 | | { |
| | | 6 | | /// <summary> |
| | | 7 | | /// Encapsulates the results of an asynchronous download operation. |
| | | 8 | | /// </summary> |
| | | 9 | | public class SftpDownloadAsyncResult : AsyncResult |
| | | 10 | | { |
| | | 11 | | /// <summary> |
| | | 12 | | /// Gets or sets a value indicating whether to cancel asynchronous download operation. |
| | | 13 | | /// </summary> |
| | | 14 | | /// <value> |
| | | 15 | | /// <see langword="true"/> if download operation to be canceled; otherwise, <see langword="false"/>. |
| | | 16 | | /// </value> |
| | | 17 | | /// <remarks> |
| | | 18 | | /// Download operation will be canceled after finishing uploading current buffer. |
| | | 19 | | /// </remarks> |
| | 1660 | 20 | | public bool IsDownloadCanceled { get; set; } |
| | | 21 | | |
| | | 22 | | /// <summary> |
| | | 23 | | /// Gets the number of downloaded bytes. |
| | | 24 | | /// </summary> |
| | 1685 | 25 | | public ulong DownloadedBytes { get; private set; } |
| | | 26 | | |
| | | 27 | | /// <summary> |
| | | 28 | | /// Initializes a new instance of the <see cref="SftpDownloadAsyncResult"/> class. |
| | | 29 | | /// </summary> |
| | | 30 | | /// <param name="asyncCallback">The async callback.</param> |
| | | 31 | | /// <param name="state">The state.</param> |
| | | 32 | | public SftpDownloadAsyncResult(AsyncCallback asyncCallback, object state) |
| | 25 | 33 | | : base(asyncCallback, state) |
| | 25 | 34 | | { |
| | 25 | 35 | | } |
| | | 36 | | |
| | | 37 | | /// <summary> |
| | | 38 | | /// Updates asynchronous operation status information. |
| | | 39 | | /// </summary> |
| | | 40 | | /// <param name="downloadedBytes">Number of downloaded bytes.</param> |
| | | 41 | | internal void Update(ulong downloadedBytes) |
| | 1649 | 42 | | { |
| | 1649 | 43 | | DownloadedBytes = downloadedBytes; |
| | 1649 | 44 | | } |
| | | 45 | | } |
| | | 46 | | } |