ILayerContainer.Comments 屬性

取得包含在此元素中的註解 (而非連結至此元素的註解)。

命名空間:  Microsoft.VisualStudio.ArchitectureTools.Extensibility.Layer
組件:  Microsoft.VisualStudio.ArchitectureTools.Extensibility.Layer (在 Microsoft.VisualStudio.ArchitectureTools.Extensibility.Layer.dll 中)

語法

'宣告
ReadOnly Property Comments As IEnumerable(Of ILayerComment)
IEnumerable<ILayerComment> Comments { get; }
property IEnumerable<ILayerComment^>^ Comments {
    IEnumerable<ILayerComment^>^ get ();
}
abstract Comments : IEnumerable<ILayerComment>
function get Comments () : IEnumerable<ILayerComment>

屬性值

型別:System.Collections.Generic.IEnumerable<ILayerComment>

備註

這個屬性會取得容器內包含的註解,但不是與它連結的那些註解。

若要取得附加至圖層項目的註解,請使用:

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

.NET Framework 安全性

請參閱

參考

ILayerContainer 介面

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

CreateComment