ShapeElement Class

Represents a diagram or a shape or connector in a diagram. ShapeElements encapsulate the visual presentation of model elements.

Namespace:  Microsoft.VisualStudio.Modeling.Diagrams
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.dll)

Syntax

'Declaration
<DisplayNameResourceAttribute("Microsoft.VisualStudio.Modeling.Diagrams.ShapeElement.DisplayName",  _
    GetType(CoreDesignSurfaceDomainModel), "Microsoft.VisualStudio.Modeling.Diagrams.GeneratedCode.DomainModelResx")> _
<DescriptionResourceAttribute("Microsoft.VisualStudio.Modeling.Diagrams.ShapeElement.Description",  _
    GetType(CoreDesignSurfaceDomainModel), "Microsoft.VisualStudio.Modeling.Diagrams.GeneratedCode.DomainModelResx")> _
<DomainObjectIdAttribute("ffb3d9f5-7a47-4e12-8501-0055bd018825")> _
<CLSCompliantAttribute(True)> _
Public MustInherit Class ShapeElement _
    Inherits PresentationElement _
    Implements IGeometryHost
'Usage
Dim instance As ShapeElement
[DisplayNameResourceAttribute("Microsoft.VisualStudio.Modeling.Diagrams.ShapeElement.DisplayName", 
    typeof(CoreDesignSurfaceDomainModel), "Microsoft.VisualStudio.Modeling.Diagrams.GeneratedCode.DomainModelResx")]
[DescriptionResourceAttribute("Microsoft.VisualStudio.Modeling.Diagrams.ShapeElement.Description", 
    typeof(CoreDesignSurfaceDomainModel), "Microsoft.VisualStudio.Modeling.Diagrams.GeneratedCode.DomainModelResx")]
[DomainObjectIdAttribute("ffb3d9f5-7a47-4e12-8501-0055bd018825")]
[CLSCompliantAttribute(true)]
public abstract class ShapeElement : PresentationElement, 
    IGeometryHost
[DisplayNameResourceAttribute(L"Microsoft.VisualStudio.Modeling.Diagrams.ShapeElement.DisplayName", 
    typeof(CoreDesignSurfaceDomainModel), L"Microsoft.VisualStudio.Modeling.Diagrams.GeneratedCode.DomainModelResx")]
[DescriptionResourceAttribute(L"Microsoft.VisualStudio.Modeling.Diagrams.ShapeElement.Description", 
    typeof(CoreDesignSurfaceDomainModel), L"Microsoft.VisualStudio.Modeling.Diagrams.GeneratedCode.DomainModelResx")]
[DomainObjectIdAttribute(L"ffb3d9f5-7a47-4e12-8501-0055bd018825")]
[CLSCompliantAttribute(true)]
public ref class ShapeElement abstract : public PresentationElement, 
    IGeometryHost
public abstract class ShapeElement extends PresentationElement implements IGeometryHost

Remarks

To navigate to the model element or relationship that the shape represents, use ModelElement.

Important subtypes include:

  • Diagram – represents a collection of shapes and connectors. The content of a Diagram is persisted in a .diagram file. If you specify a diagram class in your DSL Definition, it is derived from this class.

  • NodeShape – represents a shape that has a non-zero area, not a connector. If you specify shape classes in your DSL Definition, they are derived from NodeShape.

  • BinaryLinkShape – represents a line between two NodeShapes. If you specify connector classes in your DSL Definition, they are derived from this BinaryLinkShape.

For more information, see How to: Access a Presentation Element from a Model Element.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Modeling.ModelElement
    Microsoft.VisualStudio.Modeling.Diagrams.PresentationElement
      Microsoft.VisualStudio.Modeling.Diagrams.ShapeElement
        Microsoft.VisualStudio.Modeling.Diagrams.LinkShape
        Microsoft.VisualStudio.Modeling.Diagrams.NodeShape

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

ShapeElement Members

Microsoft.VisualStudio.Modeling.Diagrams Namespace

Other Resources

How to: Access a Presentation Element from a Model Element

Change History

Date

History

Reason

Extended and clarified descriptions.

Customer feedback.