misc: Code cleanup

This commit is contained in:
Evan Husted 2024-10-25 08:34:50 -05:00
parent c69904afc6
commit 281be7ca62
19 changed files with 136 additions and 156 deletions

View file

@ -42,7 +42,7 @@ namespace Ryujinx.Ava.UI.Helpers
PrimaryButtonCommand = MiniCommand.Create(() =>
{
result = primaryButtonResult;
}),
})
};
contentDialog.SecondaryButtonCommand = MiniCommand.Create(() =>

View file

@ -1,5 +1,6 @@
using Avalonia.Logging;
using Avalonia.Utilities;
using Gommon;
using Ryujinx.Common.Logging;
using System;
using System.Text;
@ -90,7 +91,7 @@ namespace Ryujinx.Ava.UI.Helpers
if (source != null)
{
result.Append(" (");
result.Append(source.GetType().Name);
result.Append(source.GetType().AsFullNamePrettyString());
result.Append(" #");
result.Append(source.GetHashCode());
result.Append(')');

View file

@ -35,7 +35,7 @@ namespace Ryujinx.Ava.UI.Helpers
{
Text = text,
Source = this,
RoutedEvent = TextInputEvent,
RoutedEvent = TextInputEvent
});
}
}

View file

@ -9,20 +9,12 @@ namespace Ryujinx.Ava.UI.Helpers
{
public static TimeZoneConverter Instance = new();
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
{
return null;
}
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
=> value is TimeZone timeZone
? $"{timeZone.UtcDifference} {timeZone.Location} {timeZone.Abbreviation}"
: null;
var timeZone = (TimeZone)value;
return string.Format("{0} {1} {2}", timeZone.UtcDifference, timeZone.Location, timeZone.Abbreviation);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
=> throw new NotImplementedException();
}
}