TypeDescriptionProvider 類別

定義

提供補充性中繼資料給 TypeDescriptorProvides supplemental metadata to the TypeDescriptor.

public ref class TypeDescriptionProvider abstract
public abstract class TypeDescriptionProvider
type TypeDescriptionProvider = class
Public MustInherit Class TypeDescriptionProvider
繼承
TypeDescriptionProvider
衍生

備註

TypeDescriptionProvider類別會擴充以動態方式新增、 修改或隱藏特性,例如屬性、 屬性和事件與型別或物件相關聯的型別資訊。The TypeDescriptionProvider class dynamically extends the type information associated with a type or object by adding, modifying, or hiding characteristics such as attributes, properties, and events. 可以有多個型別描述提供者的類別提供中繼資料,以單一TypeDescriptorThere can be multiple type description provider classes that offer metadata to a single TypeDescriptor.

有兩種方式可建立關聯TypeDescriptionProviderTypeDescriptor:There are two ways to associate a TypeDescriptionProvider with a TypeDescriptor:

TypeDescriptionProvider類別必須仰賴相同的類型,在建構期間所提供的父物件。The TypeDescriptionProvider class relies on a parent object of the same type, supplied during construction. 這可讓衍生自類別CustomTypeDescriptor選擇性地覆寫方法。This allows classes that derive from CustomTypeDescriptor to selectively override methods.

執行個體TypeDescriptionProvider只根據需求,自訂的型別資訊,對效能的影響降到最低。Instances of TypeDescriptionProvider are only built upon demand, minimizing the impact of custom type information on performance.

給實施者的注意事項

衍生的型別可能會標示為internal或是private,但您類型的執行個體可以使用建立TypeDescriptor類別。Your derived type might be marked as internal or private, but an instance of your type can be created with the TypeDescriptor class. 不要撰寫安全的程式碼假設呼叫端受信任。Do not write insecure code by assuming the caller is trusted. 相反地,假設呼叫端可能會建立您的型別執行個體,在部分信任中。Assume instead that callers might create instances of your type in partial trust.

建構函式

TypeDescriptionProvider()

初始化 TypeDescriptionProvider 類別的新執行個體。Initializes a new instance of the TypeDescriptionProvider class.

TypeDescriptionProvider(TypeDescriptionProvider)

使用父型別描述提供者,初始化 TypeDescriptionProvider 類別的新執行個體。Initializes a new instance of the TypeDescriptionProvider class using a parent type description provider.

方法

CreateInstance(IServiceProvider, Type, Type[], Object[])

建立可以代替另一種資料類型的物件。Creates an object that can substitute for another data type.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetCache(Object)

取得個別物件的快取,以索引鍵/值組的 IDictionary 方式存取。Gets a per-object cache, accessed as an IDictionary of key/value pairs.

GetExtendedTypeDescriptor(Object)

取得特定物件的擴充自訂型別描述項。Gets an extended custom type descriptor for the given object.

GetExtenderProviders(Object)

取得指定之物件的擴充項提供者。Gets the extender providers for the specified object.

GetFullComponentName(Object)

取得指定之元件的名稱,或 null (如果元件沒有名稱)。Gets the name of the specified component, or null if the component has no name.

GetHashCode()

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)
GetReflectionType(Object)

對指定的物件執行一般反映。Performs normal reflection against the given object.

GetReflectionType(Type)

對型別執行一般反映。Performs normal reflection against a type.

GetReflectionType(Type, Object)

對具有特定型別的特定物件執行一般反映。Performs normal reflection against the given object with the given type.

GetRuntimeType(Type)

將反映型別轉換成執行階段型別。Converts a reflection type into a runtime type.

GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
GetTypeDescriptor(Object)

取得特定物件的自訂型別描述項。Gets a custom type descriptor for the given object.

GetTypeDescriptor(Type)

取得特定型別的自訂型別描述項。Gets a custom type descriptor for the given type.

GetTypeDescriptor(Type, Object)

取得特定型別和物件的自訂型別描述項。Gets a custom type descriptor for the given type and object.

IsSupportedType(Type)

取得值,這個值指出指定的型別是否與型別描述及其型別描述提供者的鏈結相容。Gets a value that indicates whether the specified type is compatible with the type description and its chain of type description providers.

MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於

另請參閱