ApiBaseItem.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Collections.Generic;
  3. using MediaBrowser.Model.Users;
  4. namespace MediaBrowser.Model.Entities
  5. {
  6. /// <summary>
  7. /// This is a concrete class that the UI can use to deserialize
  8. /// It is flat in the sense that it will be used regardless of the type of BaseItem involved
  9. /// </summary>
  10. public class ApiBaseItem : BaseItem
  11. {
  12. }
  13. /// <summary>
  14. /// This is the full return object when requesting an Item
  15. /// </summary>
  16. public class ApiBaseItemWrapper<T>
  17. where T : BaseItem
  18. {
  19. public T Item { get; set; }
  20. public UserItemData UserItemData { get; set; }
  21. public IEnumerable<ApiBaseItemWrapper<T>> Children { get; set; }
  22. public bool IsFolder { get; set; }
  23. public string Type { get; set; }
  24. public bool IsType(Type type)
  25. {
  26. return IsType(type.Name);
  27. }
  28. public bool IsType(string type)
  29. {
  30. return Type.Equals(type, StringComparison.OrdinalIgnoreCase);
  31. }
  32. }
  33. }