IComment Interface
Text that can be attached to one or more elements.
Assembly: Microsoft.VisualStudio.Uml.Interfaces (in Microsoft.VisualStudio.Uml.Interfaces.dll)
| Name | Description | |
|---|---|---|
![]() | AnnotatedElements | Gets the elements to which the comment is attached. |
![]() | ApplicableStereotypes | The set of stereotypes that could be applied to this element. (Inherited from IElement.) |
![]() | AppliedStereotypes | Each IStereotypeInstance denotes that a stereotype has been applied to this element.(Inherited from IElement.) |
![]() | Body | The text of the Comment. |
![]() | Description | The description of this element. (Inherited from IElement.) |
![]() | OwnedComments | Gets Comments contained in this element (not comments linked to it). (Inherited from IElement.) |
![]() | OwnedElements | Gets Elements owned by this element. Every element has one owner, except the root IModel.(Inherited from IElement.) |
![]() | Owner | Gets the Element that owns this element. Every element except the root IModel has one owner.(Inherited from IElement.) |
![]() | OwningElement | Gets the element in which this comment is defined, such as a model. Not the same as the elements to which it is linked. |
![]() | VisibleAppliedStereotypes | (Inherited from IElement.) |
| Name | Description | |
|---|---|---|
![]() | AddReference(String^, String^, Boolean) | Links a string to an element, usually where the string is a reference such as a URI, modelbus reference, or work item ID. Use the name to indicate the type of reference. Returns an IReference object that represents the link.(Defined by UmlExtensions.) |
![]() | ApplyStereotype(IStereotype^) | Applies the stereotype to element. Creates an IStereotypeInstance that represents the extension of the model element by the stereotype.(Defined by ProfileStereotypeExtensions.) |
![]() | Delete() | Deletes this element and any relationships, owned elements, and shapes.(Defined by UmlExtensions.) |
![]() | DeleteAllReference(String^) | Remove all the references of a given tag.(Defined by UmlExtensions.) |
![]() | GetId() | Gets a GUID that identifies this element.(Defined by UmlExtensions.) |
![]() | GetModelStore() | Overloaded. Gets the IModelStore that contains this element.(Defined by UmlExtensions.) |
![]() | GetReferences(String^) | Get the IReferences of a given tag that are associated with this element.(Defined by UmlExtensions.) |
![]() | GetRelatedElements<T>() | Gets elements related to this element by relationships of the specified type.(Defined by UmlExtensions.) |
![]() | GetRelatedLinks<T>() | Gets relationships of a specified type from or to this element.(Defined by UmlExtensions.) |
![]() | SetOwner(IPackage^) | Overloaded. Change the owner.(Defined by SetOwnerExtensions.) |
![]() | Shapes(IDiagram^) | Overloaded. All the shapes that display the model element on any open diagram, or on a specified open diagram.(Defined by PresentationHelpers.) |
Note |
|---|
The methods defined on this type are extension methods. To use the methods, you must add a project reference to the .NET assembly Microsoft.VisualStudio.ArchitectureTools.Extensibility.dll, and you must include the directive using Microsoft.VisualStudio.ArchitectureTools.Extensibility.Uml; in your code. |
To get comments linked to an element, use:
IEnumerable <IComment> comments = store.AllInstances<IComment>() .Where(eachComment => eachComment.AnnotatedElements.Contains(element));
Notice that the OwningElement is the package, model, or other container in which the Comment is contained. It is not the element that is linked to the comment.


