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