UserDto.cs 3.0 KB

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