public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
var intValue = value as int?;
if (intValue != null)
{
if (intValue.Value == 0)
{
return this.WhenZero;
}
return (intValue.Value > 1) ? this.WhenMany : this.WhenOne;
}
var doubleValue = value as double?;
if (doubleValue != null)
{
if (doubleValue.Value == 0)
{
return this.WhenZero;
}
return (doubleValue.Value > 1) ? this.WhenMany : this.WhenOne;
}
var decimalValue = value as decimal?;
if (decimalValue != null)
{
if (decimalValue.Value == 0)
{
return this.WhenZero;
}
return (decimalValue.Value > 1) ? this.WhenMany : this.WhenOne;
}
return WhenNull;
}