StaticResultOptions.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 string Path { get; set; }
  21. public FileShareMode FileShare { get; set; }
  22. public StaticResultOptions()
  23. {
  24. ResponseHeaders = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
  25. FileShare = FileShareMode.Read;
  26. }
  27. }
  28. public class StaticFileResultOptions : StaticResultOptions
  29. {
  30. }
  31. }