ShapeDecorator Class

Definition

Class to encapsulate the way ShapeFields and child shapes are used to represent Notation Decorators when they are placed on a Shape

public ref class ShapeDecorator : Microsoft::VisualStudio::Modeling::Diagrams::Decorator
public class ShapeDecorator : Microsoft.VisualStudio.Modeling.Diagrams.Decorator
type ShapeDecorator = class
    inherit Decorator
Public Class ShapeDecorator
Inherits Decorator
Inheritance
ShapeDecorator
Derived

Remarks

Inner shapes are simple ShapeFields, whereas Outer shapes require host shapes

Constructors

ShapeDecorator(ShapeField, ShapeDecoratorPosition)

Construct a new ShapeDecorator.

ShapeDecorator(ShapeField, ShapeDecoratorPosition, Boolean)

Construct a new ShapeDecorator.

ShapeDecorator(ShapeField, ShapeDecoratorPosition, PointD)

Construct a new ShapeDecorator.

ShapeDecorator(ShapeField, ShapeDecoratorPosition, PointD, Boolean)

Construct a new ShapeDecorator.

Properties

CanMove

Whether this decorator can be moved. A decorator can be moved only if it is instantiated as moveable and also requires a host.

(Inherited from Decorator)
DecoratorAnchorMargins

Helper to get the size of the Margins specified in the ShapeField's anchoring.

(Inherited from Decorator)
Field

The ShapeField item that this decorator specifies.

(Inherited from Decorator)
Offset

Gets or sets the offset used to modify the default position of the decorator specified by position. How it works:

For non-centered shape positions the X and/or Y offset coordinate is simply added to the X and/or Y position of the decorator.

For centered shape positions, the X and/or Y offset coordinate is treated as a percentage in the range 0 to 1.0, and is added to 0.5 to modify the position of the decorator.

For connector decorators, the X and/or Y offset coordinates modify the distance between the decorator and the line and/or shape the line connects to. The greater the offset, the greater the distance.

For example, if a shape decorator position of OuterMiddleLeft is specified, and the offset is (-0.1, 0.1), then the decorator will be shifted 0.1 units to the left and placed 60% of the way between the top and bottom of the shape.

(Inherited from Decorator)
Position

Gets or sets the position of this decorator relative to the parent shape.

RequiresHost

For shapes, outer shape decorators require an additional host shape; inner decorators are implemented as shape fields on the shape itself.

Methods

AssociateValueWith(Store, AssociatedPropertyInfo)

Associates this decorator with a domain property.

(Inherited from Decorator)
AssociateValueWith(Store, Guid)

Associates this decorator with an IMS property on the ShapeElement hosting the decorator.

(Inherited from Decorator)
AssociateValueWith(Store, Guid, AssociatedPropertyInfo) (Inherited from Decorator)
AssociateVisibilityWith(Store, AssociatedPropertyInfo)

Associates this decorator's visibility with domain property.

(Inherited from Decorator)
AssociateVisibilityWith(Store, Guid)

Associates this decorator's visibility with an IMS property on the ShapeElement hosting the decorator.

(Inherited from Decorator)
AssociateVisibilityWith(Store, Guid, AssociatedPropertyInfo)

Associates this decorator's visibility with a domain property, when the shape is mapped to an instance of the given domain class. Use this method when there are multiple domain classes that this decorator can be mapped to.

(Inherited from Decorator)
ConfigureHostShape(ShapeElement)

Configures a host shape for use with this decorator.
If the given parent does not have a host shape for this decorator, a new one will be created. If a host shape already exists, settings for this decorator will be re-applied to the existing host shape; a new host shape will not be created.

GetHostShape(ShapeElement) (Inherited from Decorator)
GetValue(ShapeElement)

Gets the value associated with this decorator and the given parent shape.

(Inherited from Decorator)
GetVisible(ShapeElement)

Gets the visibility of this decorator in the context of the given parent shape.

(Inherited from Decorator)
OnAfterOffsetChanged()

Shape decorators need to update anchoring after the offset changes.

RepositionHostShape(DecoratorHostShape)

Updates the position of the given host shape based on current decorator settings.

SetValue(ShapeElement, Object)

Sets the value associated with this decorator and the given parent shape.

(Inherited from Decorator)
SetVisible(ShapeElement, Object)

Sets the visibility of this decorator in the context of the given parent shape.

(Inherited from Decorator)
UpdateDecoratorHostShapes(ModelElement)

Given a model element, finds all mapped presentation elements, and updates the corresponding decorator host shape bounds.

(Inherited from Decorator)
UpdateDecoratorHostShapes(ModelElement, Guid)

Given a model element, finds all mapped presentation elements, and updates the corresponding decorator host shape bounds.

(Inherited from Decorator)
UpdateHostShapeVisibility(DecoratorHostShape) (Inherited from Decorator)

Applies to