ILayerComment Interface

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Comment element. A comment can be contained in a layer model or in a layer, and can also be linked to any number of layers.

Namespace:  Microsoft.VisualStudio.ArchitectureTools.Extensibility.Layer
Assembly:  Microsoft.VisualStudio.ArchitectureTools.Extensibility.Layer (in Microsoft.VisualStudio.ArchitectureTools.Extensibility.Layer.dll)

public interface ILayerComment : ILayerElement

The ILayerComment type exposes the following members.

  NameDescription
Public propertyBodyGet/set the comment text.
Public propertyDescription (Inherited from ILayerElement.)
Public propertyId (Inherited from ILayerElement.)
Public propertyIsDeleted (Inherited from ILayerElement.)
Public propertyLinksGets the elements linked to this comment.
Public propertyName (Inherited from ILayerElement.)
Public propertyParentGet the parent container, either an ILayer or an ILayerModel.
Public propertyProperties (Inherited from ILayerElement.)
Top

  NameDescription
Public Extension MethodCreateCommentLink(ILayer)Overloaded. Link this comment to a layer. (Defined by Extensions.)
Public Extension MethodCreateCommentLink(ILayerComment)Overloaded. Link this layer to a comment. (Defined by Extensions.)
Public Extension MethodDeleteDelete the element. (Defined by Extensions.)
Public Extension MethodGetShapeGet the shape that presents this layer element. (Defined by Extensions.)
Top

To obtain the comments attached to a layer element, use:

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

Notice that the Comments property of an ILayerElement gets comments that are contained within the ILayerElement - not comments that are linked to it.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft