StaticResultOptions.cs 1.1 KB

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