ExtensionElement.CanMerge(ProtoElementBase, ElementGroupPrototype) 方法

定义

返回一个值,该值指示是否可以将指定根 ProtoElement 表示的源元素添加到此元素。Returns a value indicating whether the source element represented by the specified root ProtoElement can be added to this element.

protected:
 override bool CanMerge(Microsoft::VisualStudio::Modeling::ProtoElementBase ^ rootElement, Microsoft::VisualStudio::Modeling::ElementGroupPrototype ^ elementGroupPrototype);
protected override bool CanMerge (Microsoft.VisualStudio.Modeling.ProtoElementBase rootElement, Microsoft.VisualStudio.Modeling.ElementGroupPrototype elementGroupPrototype);
override this.CanMerge : Microsoft.VisualStudio.Modeling.ProtoElementBase * Microsoft.VisualStudio.Modeling.ElementGroupPrototype -> bool
Protected Overrides Function CanMerge (rootElement As ProtoElementBase, elementGroupPrototype As ElementGroupPrototype) As Boolean

参数

rootElement
ProtoElementBase

表示源元素的根 ProtoElement。The root ProtoElement representing a source element. 此值可以为 null,在这种情况下,Elementgroupprototype 创建 elementgroup 不包含 ProtoElements,代码应检查 Elementgroupprototype 创建 elementgroup 上下文信息。This can be null, in which case the ElementGroupPrototype does not contain an ProtoElements and the code should inspect the ElementGroupPrototype context information.

elementGroupPrototype
ElementGroupPrototype

包含根 ProtoElement 的 Elementgroupprototype 创建 elementgroup。The ElementGroupPrototype that contains the root ProtoElement.

返回

Boolean

如果可以将 ProtoElement 表示的源元素添加到此目标元素,则为 true。true if the source element represented by the ProtoElement can be added to this target element.

注解

替代,因为我们必须询问扩展的 MEL 是否将接受 ExtensionElements 的合并。Override because we must ask the extended MEL whether it will accept the merge of ExtensionElements. 这是为了使我们可以拒绝 MEXs 的合并,这会产生不明确的角色或属性。This is necessary to allow us to refuse merges of MEXs that would create ambiguous roles or properties.

适用于