CosCallback.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using COSXML.Model;
  5. using COSXML.CosException;
  6. using System.IO;
  7. namespace COSXML.Callback
  8. {
  9. /// <summary>
  10. /// 上传、下载进度回调
  11. /// </summary>
  12. /// <param name="completed"></param>
  13. /// <param name="total"></param>
  14. public delegate void OnProgressCallback(long completed, long total);
  15. /// <summary>
  16. /// 获取结果的回调
  17. /// </summary>
  18. public delegate void OnNotifyGetResponse();
  19. /// <summary>
  20. /// 请求成功回调
  21. /// </summary>
  22. /// <typeparam name="T1"></typeparam>
  23. /// <typeparam name="T2"></typeparam>
  24. /// <param name="cosRequest"></param>
  25. /// <param name="cosResult"></param>
  26. public delegate void OnSuccessCallback<T>(T cosResult)
  27. where T : CosResult;
  28. /// <summary>
  29. /// 请求失败回调
  30. /// </summary>
  31. /// <typeparam name="T"></typeparam>
  32. /// <param name="cosRequest"></param>
  33. /// <param name="clientException"></param>
  34. /// <param name="serverException"></param>
  35. public delegate void OnFailedCallback(CosClientException clientException, CosServerException serverException);
  36. /// <summary>
  37. /// 解析流回调
  38. /// </summary>
  39. /// <param name="inputStream"></param>
  40. /// <param name="contentType"></param>
  41. /// <param name="contentLength"></param>
  42. /// <exception cref="CosServerException">throw CosServerException</exception>
  43. /// <exception cref="CosClientException">throw CosClientException</exception>
  44. /// <exception cref="Exception"> throw Excetpion</exception>
  45. public delegate void OnParseStream(Stream inputStream, string contentType, long contentLength);
  46. }