TypeDescriptionProvider.GetExtendedTypeDescriptor(Object) 方法


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

 virtual System::ComponentModel::ICustomTypeDescriptor ^ GetExtendedTypeDescriptor(System::Object ^ instance);
public virtual System.ComponentModel.ICustomTypeDescriptor GetExtendedTypeDescriptor (object instance);
abstract member GetExtendedTypeDescriptor : obj -> System.ComponentModel.ICustomTypeDescriptor
override this.GetExtendedTypeDescriptor : obj -> System.ComponentModel.ICustomTypeDescriptor
Public Overridable Function GetExtendedTypeDescriptor (instance As Object) As ICustomTypeDescriptor



要為其取得擴充型別描述項的物件。The object for which to get the extended type descriptor.



ICustomTypeDescriptor,可以提供物件的擴充中繼資料。An ICustomTypeDescriptor that can provide extended metadata for the object.


擴充類型描述元是一個自訂類型描述元,可提供其他物件已加入至這個物件的屬性,但實際上並不是在物件上定義。An extended type descriptor is a custom type descriptor that offers properties that other objects have added to this object, but that are not actually defined on the object. 例如,在 .NET Framework.NET Framework 元件模型中,執行 IExtenderProvider 介面的物件可以將屬性附加至位於相同邏輯容器中的其他物件。For example, in the .NET Framework.NET Framework component model, objects that implement the IExtenderProvider interface can attach properties to other objects that reside in the same logical container. 多載的 GetTypeDescriptor 方法不會傳回提供這些額外擴充屬性的類型描述元。The overloaded GetTypeDescriptor methods do not return a type descriptor that provides these extra extended properties. GetExtendedTypeDescriptor 方法會傳回這些擴充屬性的集合。The GetExtendedTypeDescriptor method returns the set of these extended properties. TypeDescriptor 會自動合併這兩個屬性集合的結果。The TypeDescriptor will automatically merge the results of these two property collections. 雖然 .NET Framework.NET Framework 元件模型僅支援擴充屬性,但如果類型描述提供者支援,則 GetExtendedTypeDescriptor 可以用於擴充屬性和事件。While the .NET Framework.NET Framework component model supports only extended properties, GetExtendedTypeDescriptor can be used for extended attributes as well as events, if the type description provider supports it.

GetExtendedTypeDescriptorvirtual,而且根據預設,會傳回自訂類型描述元,如果未傳遞父提供者,則會傳回空的結果。GetExtendedTypeDescriptor is virtual and, by default, returns a custom type descriptor that returns empty results if no parent provider was passed. 如果傳遞了父提供者,這個方法將會叫用父提供者的 GetExtendedTypeDescriptor 方法。If a parent provider was passed, this method will invoke the parent provider's GetExtendedTypeDescriptor method.