UserDto.cs 3.8 KB

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