BooleanConverter Sınıf

Tanım

Çeşitli diğer gösterimlerden nesneleri dönüştürmek için bir tür dönüştürücüsü sağlar Boolean .Provides a type converter to convert Boolean objects to and from various other representations.

public ref class BooleanConverter : System::ComponentModel::TypeConverter
public class BooleanConverter : System.ComponentModel.TypeConverter
type BooleanConverter = class
    inherit TypeConverter
Public Class BooleanConverter
Inherits TypeConverter
Devralma
BooleanConverter

Örnekler

Aşağıdaki kod örneği, türünde bir değişkeni bir Boolean dizeye ve bir dizeden dönüştürür.The following code example converts a variable of type Boolean to and from a string.

bool bVal(true);
String^ strA = "false";
Console::WriteLine( TypeDescriptor::GetConverter( bVal )->ConvertTo( bVal, String::typeid ) );
Console::WriteLine( TypeDescriptor::GetConverter( bVal )->ConvertFrom( strA ) );
bool bVal=true;
string strA="false";
Console.WriteLine(TypeDescriptor.GetConverter(bVal).ConvertTo(bVal, typeof(string))); 
Console.WriteLine(TypeDescriptor.GetConverter(bVal).ConvertFrom(strA));
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))

Açıklamalar

Bu dönüştürücü, bir nesneyi yalnızca bir Boolean dizeden ve öğesinden dönüştürebilir.This converter can only convert a Boolean object to and from a string.

Tür dönüştürücüler hakkında daha fazla bilgi için bkz TypeConverter . temel sınıf ve nasıl yapılır: tür Dönüştürücüsü uygulama.For more information about type converters, see the TypeConverter base class and How to: Implement a Type Converter.

Not

Hiçbir şekilde bir örneğini oluşturmanız gerekir BooleanConverter .You should never create an instance of a BooleanConverter. Bunun yerine, GetConverter sınıfının yöntemini çağırın TypeDescriptor .Instead, call the GetConverter method of the TypeDescriptor class. Daha fazla bilgi için TypeConverter temel sınıftaki örneklere bakın.For more information, see the examples in the TypeConverter base class.

Oluşturucular

BooleanConverter()

BooleanConverter sınıfının yeni bir örneğini başlatır.Initializes a new instance of the BooleanConverter class.

Yöntemler

CanConvertFrom(ITypeDescriptorContext, Type)

Bu dönüştürücünün belirtilen bağlamı kullanarak verilen kaynak türündeki bir nesneyi Boole nesnesine dönüştürüp dönüştürmeyeceğini gösteren bir değer alır.Gets a value indicating whether this converter can convert an object in the given source type to a Boolean object using the specified context.

CanConvertFrom(Type)

Bu dönüştürücünün verilen türdeki bir nesneyi bu dönüştürücünün türüne dönüştürüp dönüştürmeyeceğini döndürür.Returns whether this converter can convert an object of the given type to the type of this converter.

(Devralındığı yer: TypeConverter)
CanConvertTo(ITypeDescriptorContext, Type)

Bu dönüştürücünün belirtilen bağlamı kullanarak nesneyi belirtilen türe dönüştürüp dönüştüremeyeceğini döndürür.Returns whether this converter can convert the object to the specified type, using the specified context.

(Devralındığı yer: TypeConverter)
CanConvertTo(Type)

Bu dönüştürücünün nesneyi belirtilen türe dönüştürüp dönüştürmeyeceğini döndürür.Returns whether this converter can convert the object to the specified type.

(Devralındığı yer: TypeConverter)
ConvertFrom(ITypeDescriptorContext, CultureInfo, Object)

Verilen değer nesnesini bir Boole nesnesine dönüştürür.Converts the given value object to a Boolean object.

ConvertFrom(Object)

Verilen değeri bu dönüştürücünün türüne dönüştürür.Converts the given value to the type of this converter.

(Devralındığı yer: TypeConverter)
ConvertFromInvariantString(ITypeDescriptorContext, String)

Sabit kültür ve belirtilen bağlamı kullanarak verilen dizeyi bu dönüştürücünün türüne dönüştürür.Converts the given string to the type of this converter, using the invariant culture and the specified context.

(Devralındığı yer: TypeConverter)
ConvertFromInvariantString(String)

Söz konusu dizeyi, sabit kültür kullanarak bu dönüştürücünün türüne dönüştürür.Converts the given string to the type of this converter, using the invariant culture.

(Devralındığı yer: TypeConverter)
ConvertFromString(ITypeDescriptorContext, CultureInfo, String)

Belirtilen bağlamı ve kültür bilgilerini kullanarak verilen metni bir nesneye dönüştürür.Converts the given text to an object, using the specified context and culture information.

(Devralındığı yer: TypeConverter)
ConvertFromString(ITypeDescriptorContext, String)

Belirtilen bağlamı kullanarak verilen metni bir nesneye dönüştürür.Converts the given text to an object, using the specified context.

(Devralındığı yer: TypeConverter)
ConvertFromString(String)

Belirtilen metni bir nesnesine dönüştürür.Converts the specified text to an object.

(Devralındığı yer: TypeConverter)
ConvertTo(ITypeDescriptorContext, CultureInfo, Object, Type)

Belirtilen bağlam ve kültür bilgilerini kullanarak verilen değer nesnesini belirtilen türe dönüştürür.Converts the given value object to the specified type, using the specified context and culture information.

(Devralındığı yer: TypeConverter)
ConvertTo(Object, Type)

Verilen değer nesnesini, bağımsız değişkenleri kullanarak belirtilen türe dönüştürür.Converts the given value object to the specified type, using the arguments.

(Devralındığı yer: TypeConverter)
ConvertToInvariantString(ITypeDescriptorContext, Object)

Belirtilen bağlamı kullanarak belirtilen değeri bir kültür sabit dize gösterimine dönüştürür.Converts the specified value to a culture-invariant string representation, using the specified context.

(Devralındığı yer: TypeConverter)
ConvertToInvariantString(Object)

Belirtilen değeri bir kültür sabit dize gösterimine dönüştürür.Converts the specified value to a culture-invariant string representation.

(Devralındığı yer: TypeConverter)
ConvertToString(ITypeDescriptorContext, CultureInfo, Object)

Belirtilen bağlamı ve kültür bilgilerini kullanarak verilen değeri bir dize gösterimine dönüştürür.Converts the given value to a string representation, using the specified context and culture information.

(Devralındığı yer: TypeConverter)
ConvertToString(ITypeDescriptorContext, Object)

Verilen bağlamı kullanarak verilen değeri bir dize gösterimine dönüştürür.Converts the given value to a string representation, using the given context.

(Devralındığı yer: TypeConverter)
ConvertToString(Object)

Belirtilen değeri bir dize gösterimine dönüştürür.Converts the specified value to a string representation.

(Devralındığı yer: TypeConverter)
CreateInstance(IDictionary)

ObjectNesne için belirli bir özellik değerleri kümesini yeniden oluşturur.Re-creates an Object given a set of property values for the object.

(Devralındığı yer: TypeConverter)
CreateInstance(ITypeDescriptorContext, IDictionary)

TypeConverterNesne için bir özellik değerleri kümesi verildiğinde, belirtilen bağlamı kullanarak ilişkili olduğu türün bir örneğini oluşturur.Creates an instance of the type that this TypeConverter is associated with, using the specified context, given a set of property values for the object.

(Devralındığı yer: TypeConverter)
Equals(Object)

Belirtilen nesnenin geçerli nesneye eşit olup olmadığını belirler.Determines whether the specified object is equal to the current object.

(Devralındığı yer: Object)
GetConvertFromException(Object)

Bir dönüştürme gerçekleştirilemediği zaman throw için bir özel durum döndürür.Returns an exception to throw when a conversion cannot be performed.

(Devralındığı yer: TypeConverter)
GetConvertToException(Object, Type)

Bir dönüştürme gerçekleştirilemediği zaman throw için bir özel durum döndürür.Returns an exception to throw when a conversion cannot be performed.

(Devralındığı yer: TypeConverter)
GetCreateInstanceSupported()

Bu nesne üzerindeki bir değerin değiştirilmesinin, CreateInstance(IDictionary) Yeni bir değer oluşturmak için yöntemine bir çağrı gerektirip gerektirmediğini döndürür.Returns whether changing a value on this object requires a call to the CreateInstance(IDictionary) method to create a new value.

(Devralındığı yer: TypeConverter)
GetCreateInstanceSupported(ITypeDescriptorContext)

Bu nesne üzerindeki bir değerin değiştirilmesinin CreateInstance(IDictionary) , belirtilen bağlamı kullanarak yeni bir değer oluşturmak için öğesine çağrı gerektirip gerektirmediğini döndürür.Returns whether changing a value on this object requires a call to CreateInstance(IDictionary) to create a new value, using the specified context.

(Devralındığı yer: TypeConverter)
GetHashCode()

Varsayılan karma işlevi olarak işlev görür.Serves as the default hash function.

(Devralındığı yer: Object)
GetProperties(ITypeDescriptorContext, Object)

Belirtilen bağlamı kullanarak değer parametresiyle belirtilen dizi türünün özelliklerinin koleksiyonunu döndürür.Returns a collection of properties for the type of array specified by the value parameter, using the specified context.

(Devralındığı yer: TypeConverter)
GetProperties(ITypeDescriptorContext, Object, Attribute[])

Belirtilen bağlamı ve öznitelikleri kullanarak değer parametresiyle belirtilen dizi türünün özelliklerinin koleksiyonunu döndürür.Returns a collection of properties for the type of array specified by the value parameter, using the specified context and attributes.

(Devralındığı yer: TypeConverter)
GetProperties(Object)

Değer parametresiyle belirtilen dizi türünün özelliklerinin koleksiyonunu döndürür.Returns a collection of properties for the type of array specified by the value parameter.

(Devralındığı yer: TypeConverter)
GetPropertiesSupported()

Bu nesnenin özellikleri destekleyip desteklemediğini döndürür.Returns whether this object supports properties.

(Devralındığı yer: TypeConverter)
GetPropertiesSupported(ITypeDescriptorContext)

Belirtilen bağlamı kullanarak bu nesnenin özellikleri destekleyip desteklemediğini döndürür.Returns whether this object supports properties, using the specified context.

(Devralındığı yer: TypeConverter)
GetStandardValues()

Bu tür dönüştürücüsünün tasarlanan veri türü için varsayılan bağlamdan standart değerlerden oluşan bir koleksiyon döndürür.Returns a collection of standard values from the default context for the data type this type converter is designed for.

(Devralındığı yer: TypeConverter)
GetStandardValues(ITypeDescriptorContext)

Boole veri türü için standart değerlerden oluşan bir koleksiyon alır.Gets a collection of standard values for the Boolean data type.

GetStandardValuesExclusive()

Öğesinden döndürülen Standart değerler koleksiyonunun GetStandardValues() özel bir liste olup olmadığını döndürür.Returns whether the collection of standard values returned from GetStandardValues() is an exclusive list.

(Devralındığı yer: TypeConverter)
GetStandardValuesExclusive(ITypeDescriptorContext)

Yöntemden döndürülen Standart değer listesinin özel bir liste olup olmadığını gösteren bir değer alır GetStandardValues(ITypeDescriptorContext) .Gets a value indicating whether the list of standard values returned from the GetStandardValues(ITypeDescriptorContext) method is an exclusive list.

GetStandardValuesSupported()

Bu nesnenin bir listeden çekilecek standart bir değer kümesini destekleyip desteklemediğini döndürür.Returns whether this object supports a standard set of values that can be picked from a list.

(Devralındığı yer: TypeConverter)
GetStandardValuesSupported(ITypeDescriptorContext)

Bu nesnenin bir listeden çekilecek standart bir değer kümesini destekleyip desteklemediğini gösteren bir değer alır.Gets a value indicating whether this object supports a standard set of values that can be picked from a list.

GetType()

TypeGeçerli örneği alır.Gets the Type of the current instance.

(Devralındığı yer: Object)
IsValid(ITypeDescriptorContext, Object)

Verilen değer nesnesinin bu tür ve belirtilen bağlam için geçerli olup olmadığını döndürür.Returns whether the given value object is valid for this type and for the specified context.

(Devralındığı yer: TypeConverter)
IsValid(Object)

Verilen değer nesnesinin bu tür için geçerli olup olmadığını döndürür.Returns whether the given value object is valid for this type.

(Devralındığı yer: TypeConverter)
MemberwiseClone()

Geçerli bir basit kopyasını oluşturur Object .Creates a shallow copy of the current Object.

(Devralındığı yer: Object)
SortProperties(PropertyDescriptorCollection, String[])

Bir özellik koleksiyonunu sıralar.Sorts a collection of properties.

(Devralındığı yer: TypeConverter)
ToString()

Geçerli nesneyi temsil eden dizeyi döndürür.Returns a string that represents the current object.

(Devralındığı yer: Object)

Şunlara uygulanır