UserDto.cs 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. using System.ComponentModel;
  2. using MediaBrowser.Model.Configuration;
  3. using System;
  4. using System.Runtime.Serialization;
  5. namespace MediaBrowser.Model.Dto
  6. {
  7. /// <summary>
  8. /// Class UserDto
  9. /// </summary>
  10. public class UserDto : INotifyPropertyChanged, IItemDto
  11. {
  12. /// <summary>
  13. /// Gets or sets the name.
  14. /// </summary>
  15. /// <value>The name.</value>
  16. public string Name { get; set; }
  17. /// <summary>
  18. /// Gets or sets the id.
  19. /// </summary>
  20. /// <value>The id.</value>
  21. public string Id { get; set; }
  22. /// <summary>
  23. /// Gets or sets the primary image tag.
  24. /// </summary>
  25. /// <value>The primary image tag.</value>
  26. public Guid? PrimaryImageTag { get; set; }
  27. /// <summary>
  28. /// Gets or sets a value indicating whether this instance has password.
  29. /// </summary>
  30. /// <value><c>true</c> if this instance has password; otherwise, <c>false</c>.</value>
  31. public bool HasPassword { get; set; }
  32. /// <summary>
  33. /// Gets or sets the last login date.
  34. /// </summary>
  35. /// <value>The last login date.</value>
  36. public DateTime? LastLoginDate { get; set; }
  37. /// <summary>
  38. /// Gets or sets the last activity date.
  39. /// </summary>
  40. /// <value>The last activity date.</value>
  41. public DateTime? LastActivityDate { get; set; }
  42. /// <summary>
  43. /// Gets or sets the configuration.
  44. /// </summary>
  45. /// <value>The configuration.</value>
  46. public UserConfiguration Configuration { get; set; }
  47. /// <summary>
  48. /// Gets or sets the primary image aspect ratio.
  49. /// </summary>
  50. /// <value>The primary image aspect ratio.</value>
  51. public double? PrimaryImageAspectRatio { get; set; }
  52. /// <summary>
  53. /// Gets or sets the original primary image aspect ratio.
  54. /// </summary>
  55. /// <value>The original primary image aspect ratio.</value>
  56. public double? OriginalPrimaryImageAspectRatio { get; set; }
  57. /// <summary>
  58. /// Gets a value indicating whether this instance has primary image.
  59. /// </summary>
  60. /// <value><c>true</c> if this instance has primary image; otherwise, <c>false</c>.</value>
  61. [IgnoreDataMember]
  62. public bool HasPrimaryImage
  63. {
  64. get { return PrimaryImageTag.HasValue; }
  65. }
  66. /// <summary>
  67. /// Initializes a new instance of the <see cref="UserDto"/> class.
  68. /// </summary>
  69. public UserDto()
  70. {
  71. Configuration = new UserConfiguration();
  72. }
  73. /// <summary>
  74. /// Occurs when [property changed].
  75. /// </summary>
  76. public event PropertyChangedEventHandler PropertyChanged;
  77. public override string ToString()
  78. {
  79. return Name ?? base.ToString();
  80. }
  81. }
  82. }