misc: Code cleanups.

This commit is contained in:
Evan Husted
2024-10-24 14:10:10 -05:00
parent a2cd3c2799
commit 7618ef134d
13 changed files with 45 additions and 113 deletions

View File

@@ -13,19 +13,19 @@ namespace Ryujinx.Ava.UI.Helpers
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
switch (value)
{
return null;
case null:
return null;
case byte[] buffer when targetType == typeof(IImage):
{
MemoryStream mem = new(buffer);
return new Bitmap(mem);
}
default:
throw new NotSupportedException();
}
if (value is byte[] buffer && targetType == typeof(IImage))
{
MemoryStream mem = new(buffer);
return new Bitmap(mem);
}
throw new NotSupportedException();
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)