UserDto.cs 3.1 KB

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