StaticResultOptions.cs 1.1 KB

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