ui, and controller, ecc, ecc

This commit is contained in:
2020-03-31 04:05:57 +02:00
parent 1d706b1adc
commit 97067a68a5
20 changed files with 862 additions and 396 deletions

View File

@@ -1,9 +1,11 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Windows.Data;
namespace HashCalculator.GUI.Converters
{
[SuppressMessage("Microsoft.Performance", "CA1812")]
[ValueConversion(typeof(bool), typeof(bool))]
internal class BooleanInvertConverter : IValueConverter
{

View File

@@ -0,0 +1,20 @@
using System;
using System.Globalization;
using System.Windows.Data;
namespace HashCalculator.GUI.Converters
{
[ValueConversion(typeof(int), typeof(bool))]
public class IsZeroToBooleanConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return (int)value == 0 ? false : true;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,22 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
using System.Windows.Data;
namespace HashCalculator.GUI.Converters
{
[SuppressMessage("Microsoft.Performance", "CA1812")]
internal class MultiValueEqualityConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
return values.All(x => Equals(x, values.First()));
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@@ -1,9 +1,11 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Windows.Data;
namespace HashCalculator.GUI.Converters
{
[SuppressMessage("Microsoft.Performance", "CA1812")]
[ValueConversion(typeof(InputEntry), typeof(bool))]
internal class ValidInputEntryTypeToBooleanConverter : IValueConverter
{

View File

@@ -1,11 +1,13 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
using System.Windows.Data;
namespace HashCalculator.GUI.Converters
{
[SuppressMessage("Microsoft.Performance", "CA1812")]
internal class ValueConverterAggregate : List<IValueConverter>, IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)