ElementPropertyDescriptor.SetProperty(ModelElement, DomainPropertyInfo, Object) 方法

定義

設定屬性值。Set the property value. 屬性值通常是透過 ElementPropertyDescriptor 設定。Property value is generally set via an ElementPropertyDescriptor. 它將會透過 propertyInfo 上的 SetValue 方法來直接設定,如果在 propertyInfo 上將-IsBrowsable 屬性設定為 false,則找不到 ElementPropertyDescriptor。It will be set directly via the SetValue method on propertyInfo if - IsBrowsable attribute is set to false on propertyInfo and ElementPropertyDescriptor is not found.

public:
 static void SetProperty(Microsoft::VisualStudio::Modeling::ModelElement ^ element, Microsoft::VisualStudio::Modeling::DomainPropertyInfo ^ propertyInfo, System::Object ^ value);
public static void SetProperty (Microsoft.VisualStudio.Modeling.ModelElement element, Microsoft.VisualStudio.Modeling.DomainPropertyInfo propertyInfo, object value);
static member SetProperty : Microsoft.VisualStudio.Modeling.ModelElement * Microsoft.VisualStudio.Modeling.DomainPropertyInfo * obj -> unit
Public Shared Sub SetProperty (element As ModelElement, propertyInfo As DomainPropertyInfo, value As Object)

參數

element
ModelElement
propertyInfo
DomainPropertyInfo
value
Object

例外狀況

如果找不到 ElementPropertyDescriptor,且 propertyInfo 參數上的 IsBrowsable 為 true,則擲回。Thrown if ElementPropertyDescriptor not found and IsBrowsable is true on propertyInfo parameter.

適用於