IsBoolean
Checks whether the type is Boolean.
Source
public static bool IsBoolean(this Type type)
{
return type.Equals(typeof(Boolean));
}
Example
Type type = (false).GetType();
bool isString = type.IsBoolean();
ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods
Checks whether the type is Boolean.
public static bool IsBoolean(this Type type)
{
return type.Equals(typeof(Boolean));
}
Type type = (false).GetType();
bool isString = type.IsBoolean();