ICustomTypeDescriptor.GetPropertyOwner(PropertyDescriptor) 方法

定義

傳回物件,包含指定的屬性描述項所描述的屬性。

public:
 System::Object ^ GetPropertyOwner(System::ComponentModel::PropertyDescriptor ^ pd);
public object GetPropertyOwner (System.ComponentModel.PropertyDescriptor pd);
public object? GetPropertyOwner (System.ComponentModel.PropertyDescriptor? pd);
abstract member GetPropertyOwner : System.ComponentModel.PropertyDescriptor -> obj
Public Function GetPropertyOwner (pd As PropertyDescriptor) As Object

參數

pd
PropertyDescriptor

PropertyDescriptor,代表要尋找其擁有者的屬性。

傳回

Object,代表指定之屬性的擁有者。

備註

方法 GetPropertyOwner 會擷取物件,其中包含 參數所 PropertyDescriptor 描述的屬性成員。 一般而言,和 PropertyDescriptor.SetValue 方法都需要PropertyDescriptor.GetValue這個物件。

這個方法應該會傳回物件,您可以使用,如下所示:

pd.GetValue(GetPropertyOwner(myPd));  

如果 為 myPdnull,則介面的 ICustomTypeDescriptor 實作應該會傳回默認物件 (通常是公開屬性和屬性的基底物件) 。

適用於

另請參閱