ILayerComment 接口

注释元素。 注释可包含在层模型或层中,也可以链接到任何数量的层。

命名空间:  Microsoft.VisualStudio.ArchitectureTools.Extensibility.Layer
程序集:  Microsoft.VisualStudio.ArchitectureTools.Extensibility.Layer(在 Microsoft.VisualStudio.ArchitectureTools.Extensibility.Layer.dll 中)

语法

声明
Public Interface ILayerComment _
    Inherits ILayerElement
public interface ILayerComment : ILayerElement
public interface class ILayerComment : ILayerElement
type ILayerComment =  
    interface 
        interface ILayerElement 
    end
public interface ILayerComment extends ILayerElement

ILayerComment 类型公开以下成员。

属性

  名称 说明
公共属性 Body 获取/设置注释文本。
公共属性 Description (继承自 ILayerElement。)
公共属性 Id (继承自 ILayerElement。)
公共属性 IsDeleted (继承自 ILayerElement。)
公共属性 Links 获取链接到此注释的元素。
公共属性 Name (继承自 ILayerElement。)
公共属性 Parent 获取父容器,ILayer 或者是 ILayerModel。
公共属性 Properties (继承自 ILayerElement。)

页首

扩展方法

  名称 说明
公共扩展方法 CreateCommentLink(ILayer) 已重载。 将此注释链接到层。 (由 Extensions 定义。)
公共扩展方法 CreateCommentLink(ILayerComment) 已重载。 将此层链接到注释。 (由 Extensions 定义。)
公共扩展方法 Delete 删除元素。 (由 Extensions 定义。)
公共扩展方法 GetShape 获取表示该层元素的形状。 (由 Extensions 定义。)

页首

备注

要获取附加到层元素的注释,请使用:

ILayerModel model = diagram.GetLayerModel(); 
IEnumerable<ILayerComment> comments = model.Comments
  .Where(comment => comment.Links
     .Any(link => link.Target == layerElement));

请注意,ILayerElement 的 Comments 属性可获取包含在 ILayerElement 内而不是链接到它的注释。

请参阅

参考

Microsoft.VisualStudio.ArchitectureTools.Extensibility.Layer 命名空间

CreateComment