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
- element
Type: Microsoft.VisualStudio.Uml.Classes.IElement
name
Type: System.StringTag that identifies the type of reference, and how the value is to be interpreted.
value
Type: System.StringString that identifies the target object.
allowMultiple
Type: System.BooleanIf 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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.VisualStudio.ArchitectureTools.Extensibility.Uml Namespace