StaticResultOptions.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Threading.Tasks;
  5. using MediaBrowser.Model.IO;
  6. namespace MediaBrowser.Controller.Net
  7. {
  8. public class StaticResultOptions
  9. {
  10. public string ContentType { get; set; }
  11. public TimeSpan? CacheDuration { get; set; }
  12. public DateTime? DateLastModified { get; set; }
  13. public Func<Task<Stream>> ContentFactory { get; set; }
  14. public bool IsHeadRequest { get; set; }
  15. public IDictionary<string, string> ResponseHeaders { get; set; }
  16. public Action OnComplete { get; set; }
  17. public Action OnError { get; set; }
  18. public string Path { get; set; }
  19. public long? ContentLength { get; set; }
  20. public FileShareMode FileShare { get; set; }
  21. public StaticResultOptions()
  22. {
  23. ResponseHeaders = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
  24. FileShare = FileShareMode.Read;
  25. }
  26. }
  27. public class StaticFileResultOptions : StaticResultOptions
  28. {
  29. }
  30. }