mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-23 13:14:59 +00:00
code_style: remove all IDE warnings
This commit is contained in:
parent
24ca3eaf8c
commit
f4eca45754
79 changed files with 1462 additions and 1378 deletions
|
@ -1,4 +1,5 @@
|
|||
using Avalonia.Controls;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Data.Converters;
|
||||
using Avalonia.Media;
|
||||
|
||||
|
@ -12,11 +13,11 @@ namespace SourceGit.Converters
|
|||
switch (v)
|
||||
{
|
||||
case Models.ChangeViewMode.List:
|
||||
return App.Current?.FindResource("Icons.List") as StreamGeometry;
|
||||
return Application.Current?.FindResource("Icons.List") as StreamGeometry;
|
||||
case Models.ChangeViewMode.Grid:
|
||||
return App.Current?.FindResource("Icons.Grid") as StreamGeometry;
|
||||
return Application.Current?.FindResource("Icons.Grid") as StreamGeometry;
|
||||
default:
|
||||
return App.Current?.FindResource("Icons.Tree") as StreamGeometry;
|
||||
return Application.Current?.FindResource("Icons.Tree") as StreamGeometry;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace SourceGit.Converters
|
|||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return (value as Models.Locale).Key;
|
||||
return (value as Models.Locale)?.Key;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,18 +29,21 @@ namespace SourceGit.Converters
|
|||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
var theme = (string)value;
|
||||
if (string.IsNullOrEmpty(theme))
|
||||
return ThemeVariant.Default;
|
||||
|
||||
if (theme.Equals("Light", StringComparison.OrdinalIgnoreCase))
|
||||
return ThemeVariant.Light;
|
||||
else if (theme.Equals("Dark", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
if (theme.Equals("Dark", StringComparison.OrdinalIgnoreCase))
|
||||
return ThemeVariant.Dark;
|
||||
else
|
||||
return ThemeVariant.Default;
|
||||
|
||||
return ThemeVariant.Default;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
var theme = (ThemeVariant)value;
|
||||
return theme.Key;
|
||||
return (value as ThemeVariant)?.Key;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue