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