Dela via


IShape<T> Interface

Represents a shape on a diagram. This is a more strongly-typed subtype of IShape. It is specific to a particular model element type T, such as IClassifier. You can assign to it any IShape<E> where E is a subtype of T, such as IClass.

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

Syntax

'Declaration
Public Interface IShape(Of Out T) _
    Inherits IShape
public interface IShape<out T> : IShape
generic<typename T>
public interface class IShape : IShape
type IShape<'T> =  
    interface
        interface IShape
    end
JScript does not support generic types or methods.

Type Parameters

  • out T
    This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics.

The IShape<T> type exposes the following members.

Properties

  Name Description
Public property ChildShapes Shapes that are contained within this shape. For example, the attribute and operation rows of a class shape; class shapes contained inside a package shape; ports and parts inside a component. For each ChildShape, ParentShape == this. (Inherited from IShape.)
Public property Color Gets or sets the color of the shape. (Inherited from IShape.)
Public property Diagram The diagram that contains this shape. (Inherited from IShape.)
Public property Element
Public property Height (Inherited from IShape.)
Public property ParentShape The shape that contains this shape, or null. If ParentShape is not null, this shape is a member of ParentShape.ChildShapes. (Inherited from IShape.)
Public property Width (Inherited from IShape.)
Public property XPosition (Inherited from IShape.)
Public property YPosition (Inherited from IShape.)

Top

Methods

  Name Description
Public method Delete Removes the shape from the diagram. This might or might not remove from the model the element that the shape displays. For example, removing a class shape from a class diagram does not remove the UML class from the model. (Inherited from IShape.)
Public method GetObject<T> Gets the model element represented by this shape. Supply the type of the result that you want. (Inherited from IShape.)
Public method Move Changes the position and size of the shape. (Inherited from IShape.)
Public method ToIShape<T> Cast to a type that specifies the type of the element that the shape represents. (Inherited from IShape.)

Top

Extension Methods

  Name Description
Public Extension Method GetChildShapes<T> Get child shapes that display the specified type of model element. (Defined by PresentationHelpers.)
Public Extension Method GetElement The model element that this shape represents. (Defined by IShapeExtensions.)

Top

See Also

Reference

Microsoft.VisualStudio.ArchitectureTools.Extensibility.Presentation Namespace