protected override bool Convert(T value, ComparisonConverterParameter <T> parameter, CultureInfo culture) { Comparison result = parameter.Compare(value); switch (result) { case Comparison.Equal: switch (parameter.ExpectedComparisonResult) { case Diagnostics.Comparison.Equal: case Diagnostics.Comparison.LesserOrEqual: case Diagnostics.Comparison.GreaterOrEqual: return(true); } return(false); case Comparison.Lesser: switch (parameter.ExpectedComparisonResult) { case Diagnostics.Comparison.Lesser: case Diagnostics.Comparison.LesserOrEqual: case Diagnostics.Comparison.NotEqual: return(true); } return(false); case Comparison.Greater: switch (parameter.ExpectedComparisonResult) { case Diagnostics.Comparison.Greater: case Diagnostics.Comparison.GreaterOrEqual: case Diagnostics.Comparison.NotEqual: return(true); } return(false); case Comparison.NotEqual: return(parameter.ExpectedComparisonResult == Diagnostics.Comparison.NotEqual); case Comparison.ReferenceEqual: return(parameter.ExpectedComparisonResult == Diagnostics.Comparison.ReferenceEqual); } throw new InvalidOperationException(WinCopies. #if !WinCopies3 Util. #endif Desktop.Resources.ExceptionMessages.ComparisonResultReturnedByParameterIsNotSupported); }
protected override T ConvertBack(bool value, ComparisonConverterParameter <T> parameter, CultureInfo culture) => throw new InvalidOperationException();