Auto-generate configuration dialog, fix logger names, prepare for async initialization
This commit is contained in:
29
Torch.Server/Views/Converters/BooleanAndConverter.cs
Normal file
29
Torch.Server/Views/Converters/BooleanAndConverter.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Torch.Server.Views.Converters
|
||||
{
|
||||
public class BooleanAndConverter : IMultiValueConverter
|
||||
{
|
||||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
foreach (var value in values)
|
||||
{
|
||||
if (value is bool b && b == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotSupportedException("BooleanAndConverter is a OneWay converter.");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user