DownloadChangedEventArgs.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /**
  2. * Copyright (c) 2021 Vuplex Inc. All rights reserved.
  3. *
  4. * Licensed under the Vuplex Commercial Software Library License, you may
  5. * not use this file except in compliance with the License. You may obtain
  6. * a copy of the License at
  7. *
  8. * https://vuplex.com/commercial-library-license
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. using System;
  17. namespace Vuplex.WebView {
  18. /// <summary>
  19. /// Event args for `DownloadProgressChanged`.
  20. /// </summary>
  21. public class DownloadChangedEventArgs : EventArgs {
  22. public DownloadChangedEventArgs(string contentType, string filePath, float progress, ProgressChangeType type, string url) {
  23. ContentType = contentType;
  24. FilePath = filePath;
  25. Progress = progress;
  26. Type = type;
  27. Url = url;
  28. }
  29. /// <summary>
  30. /// The mime type indicated by the `Content-Type` response header,
  31. /// or `null` if no content type was specified.
  32. /// </summary>
  33. readonly public string ContentType;
  34. /// <summary>
  35. /// The full file path of the downloaded file. Files are downloaded to
  36. /// Application.temporaryCachePath, but you can move them to a different
  37. /// location after they finish downloading.
  38. /// </summary>
  39. readonly public string FilePath;
  40. /// <summary>
  41. /// The estimated download progress, normalized to a float between 0 and 1.
  42. /// Note that not all platforms support intermediate progress updates.
  43. /// </summary>
  44. readonly public float Progress;
  45. /// <summary>
  46. /// The download progress event type. Note that not all platforms
  47. /// support the Updated event type.
  48. /// </summary>
  49. public readonly ProgressChangeType Type;
  50. /// <summary>
  51. /// The URL from which the file was downloaded.
  52. /// </summary>
  53. readonly public string Url;
  54. }
  55. }