2022-12-29 14:24:05 +00:00
|
|
|
using Ryujinx.Ava.UI.ViewModels;
|
2022-07-24 18:38:38 +01:00
|
|
|
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
|
|
|
using System;
|
|
|
|
|
2022-12-29 14:24:05 +00:00
|
|
|
namespace Ryujinx.Ava.UI.Models
|
2022-07-24 18:38:38 +01:00
|
|
|
{
|
|
|
|
public class TempProfile : BaseModel
|
|
|
|
{
|
|
|
|
private readonly UserProfile _profile;
|
2023-01-11 05:20:19 +00:00
|
|
|
private byte[] _image;
|
2022-07-24 18:38:38 +01:00
|
|
|
private string _name = String.Empty;
|
|
|
|
private UserId _userId;
|
|
|
|
|
2023-01-11 05:20:19 +00:00
|
|
|
public uint MaxProfileNameLength => 0x20;
|
|
|
|
|
2022-07-24 18:38:38 +01:00
|
|
|
public byte[] Image
|
|
|
|
{
|
|
|
|
get => _image;
|
|
|
|
set
|
|
|
|
{
|
|
|
|
_image = value;
|
|
|
|
OnPropertyChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public UserId UserId
|
|
|
|
{
|
|
|
|
get => _userId;
|
|
|
|
set
|
|
|
|
{
|
|
|
|
_userId = value;
|
|
|
|
OnPropertyChanged();
|
2023-01-11 05:20:19 +00:00
|
|
|
OnPropertyChanged(nameof(UserIdString));
|
2022-07-24 18:38:38 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-11 05:20:19 +00:00
|
|
|
public string UserIdString => _userId.ToString();
|
|
|
|
|
2022-07-24 18:38:38 +01:00
|
|
|
public string Name
|
|
|
|
{
|
|
|
|
get => _name;
|
|
|
|
set
|
|
|
|
{
|
|
|
|
_name = value;
|
|
|
|
OnPropertyChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public TempProfile(UserProfile profile)
|
|
|
|
{
|
|
|
|
_profile = profile;
|
|
|
|
|
2022-12-02 13:16:43 +00:00
|
|
|
if (_profile != null)
|
|
|
|
{
|
|
|
|
Image = profile.Image;
|
|
|
|
Name = profile.Name;
|
|
|
|
UserId = profile.UserId;
|
|
|
|
}
|
2022-07-24 18:38:38 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|