StaticResultOptions.cs 1.0 KB

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