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