Decorator Class

When overridden in a derived class, represents a decorator element in the diagram.

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

Syntax

Public MustInherit Class Decorator

Dim instance As Decorator
public abstract class Decorator
public ref class Decorator abstract
public abstract class Decorator

Remarks

Decorators are wrapped around other elements in the diagram to format them.

To guarantee that inner decorators do not overlap, you should anchor them to the diagram. To anchor decorators, first override [InitializeShapeFields] to call the base. Then use [FindShapeField] to locate the shape field to which you want to apply the decorator, and then call the appropriate anchoring method.

Examples

In the following example, the Name decorator is anchored to the right side of the Name2 decorator.

partial class WizardPageShape
{
    protected override void  InitializeShapeFields(IList<Microsoft.VisualStudio.Modeling.Diagrams.ShapeField> shapeFields)
        {
            base.InitializeShapeFields(shapeFields);
            ShapeField name = ShapeElement.FindShapeField(shapeFields, "Name");
            ShapeField name2 = ShapeElement.FindShapeField(shapeFields, "Name2");
            name.AnchoringBehavior.SetLeftAnchor(name2, AnchoringBehavior.Edge.Right, 0.01);
        }
}

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Modeling.Diagrams.Decorator
    Microsoft.VisualStudio.Modeling.Diagrams.ConnectorDecorator
    Microsoft.VisualStudio.Modeling.Diagrams.ShapeDecorator

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

Decorator Members

Microsoft.VisualStudio.Modeling.Diagrams Namespace