Int16Converter Sınıf

Tanım

16-bit işaretli tamsayı nesnelerini diğer temsillerden dönüştürmek için bir tür dönüştürücüsü sağlar.Provides a type converter to convert 16-bit signed integer objects to and from other representations.

public ref class Int16Converter : System::ComponentModel::BaseNumberConverter
public class Int16Converter : System.ComponentModel.BaseNumberConverter
type Int16Converter = class
    inherit BaseNumberConverter
Public Class Int16Converter
Inherits BaseNumberConverter
Devralma

Örnekler

Aşağıdaki kod örneği, türünde bir değişkeni Int16 bir dizeye dönüştürür ve tam tersi de geçerlidir.The following code example converts a variable of type Int16 to a string, and vice versa.

short myInt16( -10000);
String^ myInt16String = "+20000";
Console::WriteLine( TypeDescriptor::GetConverter( myInt16 )->ConvertTo( myInt16, String::typeid ) );
Console::WriteLine( TypeDescriptor::GetConverter( myInt16 )->ConvertFrom( myInt16String ) );
short myInt16 = -10000;
string myInt16String = "+20000";
Console.WriteLine(TypeDescriptor.GetConverter(myInt16).ConvertTo(myInt16, typeof(string))); 
Console.WriteLine(TypeDescriptor.GetConverter(myInt16).ConvertFrom(myInt16String));    
Dim myInt16 As Short = -10000
Dim myInt16String As String = "+20000"
Console.WriteLine(TypeDescriptor.GetConverter(myInt16).ConvertTo(myInt16, GetType(String)))
Console.WriteLine(TypeDescriptor.GetConverter(myInt16).ConvertFrom(myInt16String))

Açıklamalar

Bu dönüştürücü, bir dizeden yalnızca bir 16 bit işaretli tamsayı nesnesini dönüştürebilir.This converter can only convert a 16-bit signed integer object to and from a string. Int16Değer türü, negatif 32768 ile pozitif 32767 arasında değişen değerleri olan işaretli tamsayıları temsil eder.The Int16 value type represents signed integers with values ranging from negative 32768 through positive 32767.

Yöntemi, öğesinin ConvertFrom Parse Int16 tamsayı değeriyle yöntemini kullanır NumberStyles .The ConvertFrom method uses the Parse method of Int16 with the integer value of NumberStyles.

ConvertToYöntemi döndürülen dize için genel ("G") biçimini kullanır.The ConvertTo method uses the general ("G") format for the string returned.

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 koşulda bir örneğini oluşturmanız gerekir Int16Converter .You should never create an instance of an Int16Converter. 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

Int16Converter()

Int16Converter sınıfının yeni bir örneğini başlatır.Initializes a new instance of the Int16Converter 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)

Şunlara uygulanır