Sets a unique name on an element.
Namespace: Microsoft.VisualStudio.Modeling
Assembly: Microsoft.VisualStudio.Modeling.Sdk (in Microsoft.VisualStudio.Modeling.Sdk.dll)
Syntax
'宣言
Public Overridable Sub SetUniqueName ( _
element As ModelElement, _
container As ModelElement, _
embeddedDomainRole As DomainRoleInfo, _
baseName As String _
)
'使用
Dim instance As ElementNameProvider
Dim element As ModelElement
Dim container As ModelElement
Dim embeddedDomainRole As DomainRoleInfo
Dim baseName As String
instance.SetUniqueName(element, container, _
embeddedDomainRole, baseName)
public virtual void SetUniqueName(
ModelElement element,
ModelElement container,
DomainRoleInfo embeddedDomainRole,
string baseName
)
public:
virtual void SetUniqueName(
ModelElement^ element,
ModelElement^ container,
DomainRoleInfo^ embeddedDomainRole,
String^ baseName
)
public function SetUniqueName(
element : ModelElement,
container : ModelElement,
embeddedDomainRole : DomainRoleInfo,
baseName : String
)
Parameters
element
Type: Microsoft.VisualStudio.Modeling.ModelElementElement to assign a unique name.
container
Type: Microsoft.VisualStudio.Modeling.ModelElementContainer embedding the element.
embeddedDomainRole
Type: Microsoft.VisualStudio.Modeling.DomainRoleInfoRole played by the element in the embedding relationship.
baseName
Type: System.StringString from which the generated name should be derived.
Exceptions
| Exception | Condition |
|---|---|
| [ArgumentNullException] | The element, container or embeddedDomainRole is a a null reference (Nothing in Visual Basic) reference. |
| [InvalidOperationException] | When called outside of a transaction context, the name property is calculated, or other modeling constraints are not satisfied. |
| [NotSupportedException] | There are more than the maximum elements allowed in the container. |
Permissions
- 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.