IDiagramContext Interface

Provides access to a diagram. You can obtain an instance of this type by declaring an Imported property DiagramContext in a UML extension. You can also cast to and from EnvDTE.ProjectItem, if the item is a UML diagram.

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

Syntax

'Declaration
Public Interface IDiagramContext
public interface IDiagramContext
public interface class IDiagramContext
type IDiagramContext =  interface end
public interface IDiagramContext

The IDiagramContext type exposes the following members.

Properties

  Name Description
Public property CurrentDiagram The diagram accessible from this context. If you have obtained the IDiagramContext by casting a EnvDTE.ProjectItem, the diagram might not be the currently activated diagram.

Top

Remarks

In a UML extension such as a menu command or gesture handler, you can declare a property:

[Import] public IDiagramContext DiagramContext {get; set;}

This will be set to the Visual Studio project item containing the current diagram.

You can also cast EnvDTE.ProjectItem to this type, if the item is a UML diagram.

For more information, see the following topics:

See Also

Reference

Microsoft.VisualStudio.ArchitectureTools.Extensibility.Presentation Namespace