mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-23 08:47:10 +02:00
misc: chore: Use explicit types in the Avalonia project
This commit is contained in:
parent
3b5f6170d1
commit
be3bd0bcb5
69 changed files with 367 additions and 348 deletions
|
@ -21,7 +21,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
/// </remarks>
|
||||
public static bool ReplaceWith<T>(this AvaloniaList<T> list, T item, bool addIfNotFound = true)
|
||||
{
|
||||
var index = list.IndexOf(item);
|
||||
int index = list.IndexOf(item);
|
||||
|
||||
if (index != -1)
|
||||
{
|
||||
|
@ -45,9 +45,9 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
/// <param name="matchingList">The items to use as matching records to search for in the `sourceList', if not found this item will be added instead</params>
|
||||
public static void AddOrReplaceMatching<T>(this AvaloniaList<T> list, IList<T> sourceList, IList<T> matchingList)
|
||||
{
|
||||
foreach (var match in matchingList)
|
||||
foreach (T match in matchingList)
|
||||
{
|
||||
var index = sourceList.IndexOf(match);
|
||||
int index = sourceList.IndexOf(match);
|
||||
if (index != -1)
|
||||
{
|
||||
list.ReplaceWith(sourceList[index]);
|
||||
|
|
|
@ -121,7 +121,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
|
||||
startedDeferring = true;
|
||||
|
||||
var deferral = args.GetDeferral();
|
||||
Deferral deferral = args.GetDeferral();
|
||||
|
||||
sender.PrimaryButtonClick -= DeferClose;
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
}
|
||||
|
||||
public string this[string key] =>
|
||||
_glyphs.TryGetValue(Enum.Parse<Glyph>(key), out var val)
|
||||
_glyphs.TryGetValue(Enum.Parse<Glyph>(key), out string val)
|
||||
? val
|
||||
: string.Empty;
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
return null;
|
||||
}
|
||||
|
||||
var key = isBundled ? LocaleKeys.TitleBundledUpdateVersionLabel : LocaleKeys.TitleUpdateVersionLabel;
|
||||
LocaleKeys key = isBundled ? LocaleKeys.TitleBundledUpdateVersionLabel : LocaleKeys.TitleUpdateVersionLabel;
|
||||
return LocaleManager.Instance.UpdateAndGetDynamicValue(key, label);
|
||||
}
|
||||
|
||||
|
|
|
@ -50,8 +50,8 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
|
||||
private static string Format(AvaLogLevel level, string area, string template, object source, object[] v)
|
||||
{
|
||||
var result = new StringBuilder();
|
||||
var r = new CharacterReader(template.AsSpan());
|
||||
StringBuilder result = new StringBuilder();
|
||||
CharacterReader r = new CharacterReader(template.AsSpan());
|
||||
int i = 0;
|
||||
|
||||
result.Append('[');
|
||||
|
@ -64,7 +64,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
|
||||
while (!r.End)
|
||||
{
|
||||
var c = r.Take();
|
||||
char c = r.Take();
|
||||
|
||||
if (c != '{')
|
||||
{
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
Margin = new Thickness(0, 0, 15, 40),
|
||||
};
|
||||
|
||||
var maybeAsyncWorkQueue = new Lazy<AsyncWorkQueue<Notification>>(
|
||||
Lazy<AsyncWorkQueue<Notification>> maybeAsyncWorkQueue = new Lazy<AsyncWorkQueue<Notification>>(
|
||||
() => new AsyncWorkQueue<Notification>(notification =>
|
||||
{
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
|
@ -57,7 +57,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
|
||||
public static void Show(string title, string text, NotificationType type, bool waitingExit = false, Action onClick = null, Action onClose = null)
|
||||
{
|
||||
var delay = waitingExit ? TimeSpan.FromMilliseconds(0) : TimeSpan.FromMilliseconds(NotificationDelayInMs);
|
||||
TimeSpan delay = waitingExit ? TimeSpan.FromMilliseconds(0) : TimeSpan.FromMilliseconds(NotificationDelayInMs);
|
||||
|
||||
_notifications.Add(new Notification(title, text, type, delay, onClick, onClose));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue