GuidConverter 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 Guid .Provides a type converter to convert Guid objects to and from various other representations.

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

Örnekler

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

Guid myGuid("B80D56EC-5899-459d-83B4-1AE0BB8418E4");
String^ myGuidString = "1AA7F83F-C7F5-11D0-A376-00C04FC9DA04";
Console::WriteLine( TypeDescriptor::GetConverter( myGuid )->ConvertTo( myGuid, String::typeid ) );
Console::WriteLine( TypeDescriptor::GetConverter( myGuid )->ConvertFrom( myGuidString ) );
Guid myGuid = new Guid("B80D56EC-5899-459d-83B4-1AE0BB8418E4");
string myGuidString = "1AA7F83F-C7F5-11D0-A376-00C04FC9DA04";
Console.WriteLine(TypeDescriptor.GetConverter(myGuid).ConvertTo(myGuid, typeof(string))); 
Console.WriteLine(TypeDescriptor.GetConverter(myGuid).ConvertFrom(myGuidString));    
Dim myGuid As New Guid("B80D56EC-5899-459d-83B4-1AE0BB8418E4")
Dim myGuidString As String = "1AA7F83F-C7F5-11D0-A376-00C04FC9DA04"
Console.WriteLine(TypeDescriptor.GetConverter(myGuid).ConvertTo(myGuid, GetType(String)))
Console.WriteLine(TypeDescriptor.GetConverter(myGuid).ConvertFrom(myGuidString))

Açıklamalar

Bu dönüştürücü, bir GUID nesnesini yalnızca bir dizeden ve bir dizeye dönüştürebilir.This converter can only convert a GUID 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.

Dikkat

Hiçbir şekilde bir örneğini oluşturmanız gerekir GuidConverter .You should never create an instance of a GuidConverter. 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

GuidConverter()

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

Yöntemler

CanConvertFrom(ITypeDescriptorContext, Type)

Bu dönüştürücünün, bağlamı kullanarak verilen kaynak türündeki bir nesneyi bir GUID 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 GUID object using the 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 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 alır.Gets a value indicating whether this converter can convert an object to the given destination type using the context.

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 bir GUID nesnesine dönüştürür.Converts the given object to a GUID 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)

Verilen nesneyi başka bir türe dönüştürür.Converts the given object to another type.

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