Поделиться через


RolePlayerPropertyDescriptor.SetValue Method

Sets the value of the domain role property.

Namespace:  Microsoft.VisualStudio.Modeling.Design
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.10.0.dll)

Syntax

'Декларация
Public Overrides Sub SetValue ( _
    component As Object, _
    value As Object _
)
public override void SetValue(
    Object component,
    Object value
)
public:
virtual void SetValue(
    Object^ component, 
    Object^ value
) override
abstract SetValue : 
        component:Object * 
        value:Object -> unit 
override SetValue : 
        component:Object * 
        value:Object -> unit 
public override function SetValue(
    component : Object, 
    value : Object
)

Parameters

  • component
    Type: System.Object
    The link for which to set the value of the property.

Remarks

This method sets the value of the role property in a transaction.

When a role property changes, one of these occurs: a new link is created, the opposite role player in an existing link is changed, or the existing link is deleted. In addition, if the specified model element is a role player in a different link and the following conditions are true, then the existing link is deleted:

  • The existing link is of the same kind of domain relationship.

  • The multiplicity of the target role is one-to-one or zero-to-one.

If the Link() property of the descriptor is nulla null reference (Nothing in Visual Basic), then the component parameter specifies the link; otherwise, this method sets the value of the property in relation to the link with which it is associated. This association is formed when the property descriptor is created.

The value parameter can specify the new value in any of the following ways:

  • If the value parameter is a RolePlayerMenuCommand object, then the menu command is executed and the command result is used as the opposite role player.

  • If the value parameter is a Guid value, then the model element that has that identifier is used as the opposite role player.

  • Otherwise, the existing link is deleted.

If the role property is read-only, then its value is not changed.

.NET Framework Security

See Also

Reference

RolePlayerPropertyDescriptor Class

Microsoft.VisualStudio.Modeling.Design Namespace

PropertyType

GetValue