Freigeben über


ModelExplorerTreeContainer.IsAddableRoleForElement Method

Query whether the specified role should be considered a candidate for addition through the explorer add menus.

Namespace:  Microsoft.VisualStudio.Modeling.Shell
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Shell.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.Shell.12.0.dll)

Syntax

'Declaration
Protected Friend Overridable Function IsAddableRoleForElement ( _
    element As ModelElement, _
    role As DomainRoleInfo _
) As Boolean
protected internal virtual bool IsAddableRoleForElement(
    ModelElement element,
    DomainRoleInfo role
)
protected public:
virtual bool IsAddableRoleForElement(
    ModelElement^ element, 
    DomainRoleInfo^ role
)
abstract IsAddableRoleForElement : 
        element:ModelElement * 
        role:DomainRoleInfo -> bool  
override IsAddableRoleForElement : 
        element:ModelElement * 
        role:DomainRoleInfo -> bool
function IsAddableRoleForElement(
    element : ModelElement, 
    role : DomainRoleInfo
) : boolean

Parameters

Return Value

Type: System.Boolean
True if the role is a candidate for addition, else false

Remarks

By default only non-abstract embedded elements are addable, with the exception of the extensions. Can be overridden, but it is not recommended to include relationships that are not embeddings, as the explorer makes a general assumption that it is only adding through embeddings and its behaviour is undefined if this is not the case

.NET Framework Security

See Also

Reference

ModelExplorerTreeContainer Class

Microsoft.VisualStudio.Modeling.Shell Namespace