TempProfile.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using Ryujinx.Ava.UI.ViewModels;
  2. using Ryujinx.HLE.HOS.Services.Account.Acc;
  3. using System;
  4. namespace Ryujinx.Ava.UI.Models
  5. {
  6. public class TempProfile : BaseModel
  7. {
  8. private readonly UserProfile _profile;
  9. private byte[] _image;
  10. private string _name = String.Empty;
  11. private UserId _userId;
  12. public uint MaxProfileNameLength => 0x20;
  13. public byte[] Image
  14. {
  15. get => _image;
  16. set
  17. {
  18. _image = value;
  19. OnPropertyChanged();
  20. }
  21. }
  22. public UserId UserId
  23. {
  24. get => _userId;
  25. set
  26. {
  27. _userId = value;
  28. OnPropertyChanged();
  29. OnPropertyChanged(nameof(UserIdString));
  30. }
  31. }
  32. public string UserIdString => _userId.ToString();
  33. public string Name
  34. {
  35. get => _name;
  36. set
  37. {
  38. _name = value;
  39. OnPropertyChanged();
  40. }
  41. }
  42. public TempProfile(UserProfile profile)
  43. {
  44. _profile = profile;
  45. if (_profile != null)
  46. {
  47. Image = profile.Image;
  48. Name = profile.Name;
  49. UserId = profile.UserId;
  50. }
  51. }
  52. }
  53. }