Compartir a través de


ModelExplorerTreeContainer.IsAddableRoleForElement Method

Definition

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

protected public:
 virtual bool IsAddableRoleForElement(Microsoft::VisualStudio::Modeling::ModelElement ^ element, Microsoft::VisualStudio::Modeling::DomainRoleInfo ^ role);
protected internal virtual bool IsAddableRoleForElement (Microsoft.VisualStudio.Modeling.ModelElement element, Microsoft.VisualStudio.Modeling.DomainRoleInfo role);
abstract member IsAddableRoleForElement : Microsoft.VisualStudio.Modeling.ModelElement * Microsoft.VisualStudio.Modeling.DomainRoleInfo -> bool
override this.IsAddableRoleForElement : Microsoft.VisualStudio.Modeling.ModelElement * Microsoft.VisualStudio.Modeling.DomainRoleInfo -> bool
Protected Friend Overridable Function IsAddableRoleForElement (element As ModelElement, role As DomainRoleInfo) As Boolean

Parameters

element
ModelElement

The ModelElement into which a new child element would be merged

role
DomainRoleInfo

DomainRoleInfo describing the role

Returns

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

Applies to