ElementGroupPrototype 类

包含需要重新创建一组元素和链接的信息。 用于存放元素在工具中,在剪贴板以及在拖动操作。

继承层次结构

System.Object
  Microsoft.VisualStudio.Modeling.ElementGroupPrototype

命名空间:  Microsoft.VisualStudio.Modeling
程序集:  Microsoft.VisualStudio.Modeling.Sdk.12.0(在 Microsoft.VisualStudio.Modeling.Sdk.12.0.dll 中)

语法

声明
<SerializableAttribute> _
Public NotInheritable Class ElementGroupPrototype _
    Implements ISerializable, IDeserializationCallback
[SerializableAttribute]
public sealed class ElementGroupPrototype : ISerializable, 
    IDeserializationCallback

ElementGroupPrototype 类型公开以下成员。

构造函数

  名称 说明
公共方法 ElementGroupPrototype(ElementGroup, IEnumerable<ModelElement>) 构造函数
公共方法 ElementGroupPrototype(Partition, Guid) 采用 rool 域类 ID 的构造函数。这用于确定元素是否可合并在父元素下。
公共方法 ElementGroupPrototype(Partition, ICollection<ModelElement>, ElementGroup) 构造函数

页首

属性

  名称 说明
公共属性 ProtoElementLinks 获取包含在 ElementGroupPrototype 中的所有 ProtoElementLinks 的集合。
公共属性 ProtoElements 获取包含在 ElementGroupPrototype 中的所有 ProtoElements 的集合。
公共属性 RootProtoElements 获取在 ElementGroupPrototype 中包含的所有根 ProtoElements 的集合。
公共属性 SourceContext 返回此 ElementGroupPrototype 的源 ElementGroupContext 对象
公共属性 SourceRootElementIds 从源上下文中返回根元素 ID 的只读列表
公共属性 TargetContext 返回此 ElementGroupPrototype 的目标 ElementGroupContext 对象
公共属性 TargetRootElementIds 从目标上下文中返回根元素 ID 的只读列表
公共属性 TopLevelProtoGroup 该 ElementGroupPrototype 组原型表示
公共属性 UserData 用户从 outer-most 元素团队定义数据对象

页首

方法

  名称 说明
公共方法 CanCreateElementGroup(Partition) 该原型元素团队是否可以在指示的部件中创建上级元素团队的副本?
公共方法 CanCreateElementGroup(Store) 该原型元素团队是否可以在指示的存储区中创建上级元素团队的副本?
公共方法 CanCreateElementGroup(Partition, IElementPartitionMapper) 该原型元素团队是否可以在指示的部件中创建上级元素团队的副本?
公共方法 CreateElementGroup(Partition) 创建上级元素组的副本
公共方法 CreateElementGroup(Store) 创建上级元素组的副本
公共方法 CreateElementGroup(Partition, IElementPartitionMapper) 创建上级元素组的副本
公共方法 Equals 确定指定的对象是否等于当前对象。 (继承自 Object。)
公共方法 GetHashCode 作为默认哈希函数。 (继承自 Object。)
公共方法 GetObjectData 使用序列化此对象所需的数据来填充序列化信息。
公共方法 GetProtoElement 获取对应指定 ID 的 ProtoElement。
公共方法 GetProtoLink 获取对应指定 ID 的 ProtoLink。
公共方法 GetProtoLinks 返回包含在传递 DomainRoleId 中播放的传递 ProtoElementBase的 ProtoLink 对象的 IList。
公共方法静态成员 GetReconstitutedElement 返回给定源 ModelElement 的 guid 的重建ModelElement。
公共方法 GetSourceRootElementId 获取对应于指定的目标根 ModelElement ID的源根 ModelElement 的 ID。如果未找到它,则返回 Guid.Empty。
公共方法 GetType 获取当前实例的 Type。 (继承自 Object。)
公共方法 IsInRole 如果传递的 ProtoElementBase 播放在此 ElementGroupPrototype 中的传递角色,则返回 true。
公共方法 ResolveProtoLinks 解决传递的 ProtoLinks 的 IList 到在传递的 DomainRoleId 播放的 ProtoElements。
公共方法 ToString() 返回表示当前对象的字符串。 (继承自 Object。)
公共方法 ToString(Partition) 转储 ElementGroupPrototype 里 Elements 和 ElementLinks 的名称,给定所提供分区的 DomainClass 定义。

页首

字段

  名称 说明
公共字段静态成员 CreatingKey 上下文信息搜索的键值
公共字段静态成员 DefaultDataFormatName ElementGroupPrototype 的默认数据格式名称。
公共字段静态成员 ElementGroupIdDictionary 用于针对 Element Id 字典和根元素 (Id) 列表的 TargetContext ElementGroupContext 键值。
公共字段静态成员 RootElementIdList 用于针对 RootElement Id 列表和根元素 (Id) 列表的 Source and Target Context ElementGroupContext 键值。
公共字段静态成员 RootElementList 用于针对 RootElement 列表和根元素列表的 Source and Target Context ElementGroupContext 键值。

页首

显式接口实现  

  名称 说明
显式接口实现私有方法 IDeserializationCallback.OnDeserialization 图表完全加载时的反序列化对象

页首

备注

包含元素 ElementGroupPrototype (EGP) 和链接模式,可用于创建新组元素和链接在合并操作。 在合并过程,EGP 用于创建 ElementGroup,然后链接到目标模型的元素。

EGPs 用于以下用途:

  • 传播在拖动操作的信息;

  • 存储在剪贴板的信息;

  • 存储对象模式在工具箱中。

有关更多信息,请参见如何:程序复制和粘贴行为 - 重定向如何:添加拖放处理程序

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

请参阅

参考

Microsoft.VisualStudio.Modeling 命名空间