UmlExtensions.AddReference Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

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.Uml.Extensions
Assembly:  Microsoft.VisualStudio.Uml.Extensions (in Microsoft.VisualStudio.Uml.Extensions.dll)


<ExtensionAttribute> _
Public Shared Function AddReference ( _
    element As IElement, _
    name As String, _
    value As String, _
    allowMultiple As Boolean _
) As IReference
Dim element As IElement
Dim name As String
Dim value As String
Dim allowMultiple As Boolean
Dim returnValue As IReference

returnValue = element.AddReference(name, _
    value, allowMultiple)
public static IReference AddReference(
    this IElement element,
    string name,
    string value,
    bool allowMultiple
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


  • name
    Type: System.String
    Use this to indicate the type of reference. Use your own string, or a predefined string from ReferenceConstants. Do not use a string for which IsReservedTag is true.
  • value
    Type: System.String
    Reference value such as a URL or modelbus reference.
  • allowMultiple
    Type: System.Boolean
    Set true if more than one reference linked to this element can have the same name.

Return Value

Type: Microsoft.VisualStudio.Uml.Extensions.IReference
A new IReference linked to the element.

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


UmlExtensions Class

UmlExtensions Members

Microsoft.VisualStudio.Uml.Extensions Namespace