4 using System.Globalization;
6 namespace SiliconStudio.Presentation.ValueConverters
15 public override object Convert(
object value, Type targetType,
object parameter, CultureInfo culture)
17 if (value is sbyte)
return ((sbyte)value) != 0;
18 if (value is
short)
return ((
short)value) != 0;
19 if (value is
int)
return ((
int)value) != 0;
20 if (value is
long)
return ((
long)value) != 0;
21 if (value is byte)
return ((byte)value) != 0;
22 if (value is ushort)
return ((ushort)value) != 0;
23 if (value is uint)
return ((uint)value) != 0;
24 if (value is ulong)
return ((ulong)value) != 0;
25 throw new ArgumentException(
"value is not a numeric type");
This converter will convert a numerical value to a boolean. The result will be false if the given val...
override object Convert(object value, Type targetType, object parameter, CultureInfo culture)