misc: chore: Use explicit types in the Avalonia project

This commit is contained in:
Evan Husted
2025-01-25 14:00:23 -06:00
parent 3b5f6170d1
commit be3bd0bcb5
69 changed files with 367 additions and 348 deletions

View File

@ -106,9 +106,9 @@ namespace Ryujinx.Ava.UI.Controls
.OrderBy(x => x.Name)
.ForEach(profile => ViewModel.Profiles.Add(new UserProfile(profile, this)));
var saveDataFilter = SaveDataFilter.Make(programId: default, saveType: SaveDataType.Account, default, saveDataId: default, index: default);
SaveDataFilter saveDataFilter = SaveDataFilter.Make(programId: default, saveType: SaveDataType.Account, default, saveDataId: default, index: default);
using var saveDataIterator = new UniqueRef<SaveDataIterator>();
using UniqueRef<SaveDataIterator> saveDataIterator = new UniqueRef<SaveDataIterator>();
HorizonClient.Fs.OpenSaveDataIterator(ref saveDataIterator.Ref, SaveDataSpaceId.User, in saveDataFilter).ThrowIfFailure();
@ -127,8 +127,8 @@ namespace Ryujinx.Ava.UI.Controls
for (int i = 0; i < readCount; i++)
{
var save = saveDataInfo[i];
var id = new UserId((long)save.UserId.Id.Low, (long)save.UserId.Id.High);
SaveDataInfo save = saveDataInfo[i];
UserId id = new UserId((long)save.UserId.Id.Low, (long)save.UserId.Id.High);
if (ViewModel.Profiles.Cast<UserProfile>().FirstOrDefault(x => x.UserId == id) == null)
{
lostAccounts.Add(id);
@ -136,7 +136,7 @@ namespace Ryujinx.Ava.UI.Controls
}
}
foreach (var account in lostAccounts)
foreach (UserId account in lostAccounts)
{
ViewModel.LostProfiles.Add(new UserProfile(new HLE.HOS.Services.Account.Acc.UserProfile(account, string.Empty, null), this));
}
@ -146,12 +146,12 @@ namespace Ryujinx.Ava.UI.Controls
public async void DeleteUser(UserProfile userProfile)
{
var lastUserId = AccountManager.LastOpenedUser.UserId;
UserId lastUserId = AccountManager.LastOpenedUser.UserId;
if (userProfile.UserId == lastUserId)
{
// If we are deleting the currently open profile, then we must open something else before deleting.
var profile = ViewModel.Profiles.Cast<UserProfile>().FirstOrDefault(x => x.UserId != lastUserId);
UserProfile profile = ViewModel.Profiles.Cast<UserProfile>().FirstOrDefault(x => x.UserId != lastUserId);
if (profile == null)
{
@ -165,7 +165,7 @@ namespace Ryujinx.Ava.UI.Controls
AccountManager.OpenUser(profile.UserId);
}
var result = await ContentDialogHelper.CreateConfirmationDialog(
UserResult result = await ContentDialogHelper.CreateConfirmationDialog(
LocaleManager.Instance[LocaleKeys.DialogUserProfileDeletionConfirmMessage],
string.Empty,
LocaleManager.Instance[LocaleKeys.InputDialogYes],