共用方式為


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