CommandAsyncResult.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using System.Threading;
  3. namespace Renci.SshNet
  4. {
  5. /// <summary>
  6. /// Provides additional information for asynchronous command execution
  7. /// </summary>
  8. public class CommandAsyncResult : IAsyncResult
  9. {
  10. /// <summary>
  11. /// Initializes a new instance of the <see cref="CommandAsyncResult"/> class.
  12. /// </summary>
  13. internal CommandAsyncResult()
  14. {
  15. }
  16. /// <summary>
  17. /// Gets or sets the bytes received. If SFTP only file bytes are counted.
  18. /// </summary>
  19. /// <value>Total bytes received.</value>
  20. public int BytesReceived { get; set; }
  21. /// <summary>
  22. /// Gets or sets the bytes sent by SFTP.
  23. /// </summary>
  24. /// <value>Total bytes sent.</value>
  25. public int BytesSent { get; set; }
  26. #region IAsyncResult Members
  27. /// <summary>
  28. /// Gets a user-defined object that qualifies or contains information about an asynchronous operation.
  29. /// </summary>
  30. /// <returns>A user-defined object that qualifies or contains information about an asynchronous operation.</returns>
  31. public object AsyncState { get; internal set; }
  32. /// <summary>
  33. /// Gets a <see cref="T:System.Threading.WaitHandle"/> that is used to wait for an asynchronous operation to complete.
  34. /// </summary>
  35. /// <returns>A <see cref="T:System.Threading.WaitHandle"/> that is used to wait for an asynchronous operation to complete.</returns>
  36. public WaitHandle AsyncWaitHandle { get; internal set; }
  37. /// <summary>
  38. /// Gets a value that indicates whether the asynchronous operation completed synchronously.
  39. /// </summary>
  40. /// <returns>true if the asynchronous operation completed synchronously; otherwise, false.</returns>
  41. public bool CompletedSynchronously { get; internal set; }
  42. /// <summary>
  43. /// Gets a value that indicates whether the asynchronous operation has completed.
  44. /// </summary>
  45. /// <returns>true if the operation is complete; otherwise, false.</returns>
  46. public bool IsCompleted { get; internal set; }
  47. #endregion
  48. }
  49. }