Delen via


UmlExtensions.AddReference Method

Links a string to an element, usually where the string is a reference such as a URI, modelbus reference, or work item ID. Use the name to indicate the type of reference. Returns an IReference object that represents the link.

Namespace:  Microsoft.VisualStudio.ArchitectureTools.Extensibility.Uml
Assembly:  Microsoft.VisualStudio.ArchitectureTools.Extensibility (in Microsoft.VisualStudio.ArchitectureTools.Extensibility.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function AddReference ( _
    element As IElement, _
    name As String, _
    value As String, _
    allowMultiple As Boolean _
) As IReference
public static IReference AddReference(
    this IElement element,
    string name,
    string value,
    bool allowMultiple
)
[ExtensionAttribute]
public:
static IReference^ AddReference(
    IElement^ element, 
    String^ name, 
    String^ value, 
    bool allowMultiple
)
static member AddReference : 
        element:IElement * 
        name:string * 
        value:string * 
        allowMultiple:bool -> IReference
public static function AddReference(
    element : IElement, 
    name : String, 
    value : String, 
    allowMultiple : boolean
) : IReference

Parameters

  • name
    Type: System.String

    Tag that identifies the type of reference, and how the value is to be interpreted.

  • value
    Type: System.String

    String that identifies the target object.

  • allowMultiple
    Type: System.Boolean

    If true, more than one value with the same name can be attached to this IElement. If false, an exception will be thrown if a reference of this name is already attached to this IElement.

Return Value

Type: Microsoft.VisualStudio.ArchitectureTools.Extensibility.Uml.IReference

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IElement. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

.NET Framework Security

See Also

Reference

UmlExtensions Class

Microsoft.VisualStudio.ArchitectureTools.Extensibility.Uml Namespace