ByteConverter Sınıf
Tanım
8 bit işaretsiz tamsayı nesnelerini ve diğer birçok gösterimden dönüştürmek için bir tür dönüştürücüsü sağlar.Provides a type converter to convert 8-bit unsigned integer objects to and from various other representations.
public ref class ByteConverter : System::ComponentModel::BaseNumberConverter
public class ByteConverter : System.ComponentModel.BaseNumberConverter
type ByteConverter = class
inherit BaseNumberConverter
Public Class ByteConverter
Inherits BaseNumberConverter
- Devralma
Örnekler
Aşağıdaki kod örneği bir 8 bit işaretsiz tamsayı ve bir dize bildirir ve başlatır.The following code example declares and initializes an 8-bit unsigned integer and a string. Kod daha sonra her birini, sırasıyla diğer türüne dönüştürür.The code then converts each of them to the other's type, respectively.
Byte myUint(5);
String^ myUStr = "2";
Console::WriteLine( TypeDescriptor::GetConverter( myUint )->ConvertTo( myUint, String::typeid ) );
Console::WriteLine( TypeDescriptor::GetConverter( myUint )->ConvertFrom( myUStr ) );
byte myUint = 5;
string myUStr = "2";
Console.WriteLine(TypeDescriptor.GetConverter(myUint).ConvertTo(myUint, typeof(string)));
Console.WriteLine(TypeDescriptor.GetConverter(myUint).ConvertFrom(myUStr));
Dim myUint As Byte = 5
Dim myUStr As String = "2"
Console.WriteLine(TypeDescriptor.GetConverter(myUint).ConvertTo(myUint, GetType(String)))
Console.WriteLine(TypeDescriptor.GetConverter(myUint).ConvertFrom(myUStr))
Açıklamalar
Bu dönüştürücü, bir dizeden yalnızca bir 8 bit işaretsiz tamsayı dönüştürebilir.This converter can only convert an 8-bit unsigned integer 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 ByteConverter .You should never create an instance of a ByteConverter. Bunun yerine, GetConverter yöntemini çağırın TypeDescriptor .Instead, call the GetConverter method of TypeDescriptor. 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
| ByteConverter() |
ByteConverter sınıfının yeni bir örneğini başlatır.Initializes a new instance of the ByteConverter class. |
Yöntemler
| CanConvertFrom(ITypeDescriptorContext, Type) |
Bu dönüştürücünün verilen kaynak türündeki bir nesneyi dönüştürücünün yerel türüne dönüştürüp dönüştüremeyeceğini belirler.Determines if this converter can convert an object in the given source type to the native type of the converter. (Devralındığı yer: BaseNumberConverter) |
| 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 bağlamı kullanarak bir nesneyi verilen hedef türüne dönüştürüp dönüştürmeyeceğini gösteren bir değer döndürür.Returns a value indicating whether this converter can convert an object to the given destination type using the context. (Devralındığı yer: BaseNumberConverter) |
| 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 nesneyi dönüştürücünün yerel türüne dönüştürür.Converts the given object to the converter's native type. (Devralındığı yer: BaseNumberConverter) |
| 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 nesneyi başka bir türe dönüştürür.Converts the specified object to another type. (Devralındığı yer: BaseNumberConverter) |
| 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) |
Bu tür dönüştürücüsünün bir biçim bağlamıyla birlikte sağlandığı için tasarlandıkları veri türü için standart değerlerden oluşan bir koleksiyon döndürür.Returns a collection of standard values for the data type this type converter is designed for when provided with a format context. (Devralındığı yer: TypeConverter) |
| 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) |
' Den döndürülen Standart değerler koleksiyonunun, GetStandardValues() belirtilen bağlamı kullanarak olası değerlerin dışlamalı bir listesi olup olmadığını döndürür.Returns whether the collection of standard values returned from GetStandardValues() is an exclusive list of possible values, using the specified context. (Devralındığı yer: TypeConverter) |
| 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, belirtilen bağlamı kullanarak 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, using the specified context. (Devralındığı yer: TypeConverter) |
| 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) |