mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 23:50:18 -04:00
Sonar code smells corrections
This commit is contained in:
@@ -8,20 +8,20 @@ namespace ModernKeePass.Converters
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
var boolean = value is bool ? (bool) value : false;
|
||||
var boolean = value as bool? ?? false;
|
||||
return boolean ? Visibility.Visible : Visibility.Collapsed;
|
||||
}
|
||||
|
||||
// No need to implement this
|
||||
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
var visibility = value is Visibility ? (Visibility) value : Visibility.Visible;
|
||||
var visibility = value as Visibility? ?? Visibility.Visible;
|
||||
switch (visibility)
|
||||
{
|
||||
case Visibility.Visible: return true;
|
||||
case Visibility.Collapsed: return false;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
throw new ArgumentOutOfRangeException(nameof(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user