Provides a type converter to convert Boolean objects to and from various other representations.
For a list of all members of this type, see BooleanConverter Members.
System.Object
System.ComponentModel.TypeConverter
System.ComponentModel.BooleanConverter
[Visual Basic] Public Class BooleanConverter Inherits TypeConverter [C#] public class BooleanConverter : TypeConverter [C++] public __gc class BooleanConverter : public TypeConverter [JScript] public class BooleanConverter extends TypeConverter
Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.
This converter can only convert a Boolean object to and from a string.
For more information about type converters, see the TypeConverter base class and
Note You should never create an instance of a BooleanConverter. Instead, call the GetConverter method of TypeDescriptor. For more information, see the examples in the TypeConverter base class.
[Visual Basic, C#, C++] The following example converts a variable of type Boolean to and from a string.
[Visual Basic] Dim bVal As Boolean = True Dim strA As String = "false" Console.WriteLine(TypeDescriptor.GetConverter(bVal).ConvertTo(bVal, GetType(String))) Console.WriteLine(TypeDescriptor.GetConverter(bVal).ConvertFrom(strA)) [C#] bool bVal=true; string strA="false"; Console.WriteLine(TypeDescriptor.GetConverter(bVal).ConvertTo(bVal, typeof(string))); Console.WriteLine(TypeDescriptor.GetConverter(bVal).ConvertFrom(strA)); [C++] bool bVal( true ); String* strA = S"false"; Console::WriteLine(TypeDescriptor::GetConverter(__box(bVal))->ConvertTo(__box(bVal), __typeof(String))); Console::WriteLine(TypeDescriptor::GetConverter(__box(bVal))->ConvertFrom(strA));
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Namespace: System.ComponentModel
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
Assembly: System (in System.dll)