Compartilhar via


ShapeElement.InitializeDecorators Method

Initializes and adds fields to the shape type.

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

Syntax

'Declaração
Protected Overridable Sub InitializeDecorators ( _
    shapeFields As IList(Of ShapeField), _
    decorators As IList(Of Decorator) _
)
protected virtual void InitializeDecorators(
    IList<ShapeField> shapeFields,
    IList<Decorator> decorators
)
protected:
virtual void InitializeDecorators(
    IList<ShapeField^>^ shapeFields, 
    IList<Decorator^>^ decorators
)
abstract InitializeDecorators : 
        shapeFields:IList<ShapeField> * 
        decorators:IList<Decorator> -> unit 
override InitializeDecorators : 
        shapeFields:IList<ShapeField> * 
        decorators:IList<Decorator> -> unit 
protected function InitializeDecorators(
    shapeFields : IList<ShapeField>, 
    decorators : IList<Decorator>
)

Parameters

Remarks

This method is called after InitializeShapeFields().

You can override this method to add or customize decorators for this shape type. You must set the Generates Double Derived property of the shape.

By default, one decorator is created for each shape field. Decorators wrap shape fields, and may appear either inside or outside of the bounds of a shape (shape fields are restricted to appearing within a shape). You can see the base method in your project by inspecting DSL\GeneratedCode\Shape.cs

Examples

protected override void InitializeDecorators(IList<ShapeField> shapeFields, IList<Decorator> decorators)
{
base.InitializeDecorators(shapeFields, decorators);

ShapeField field1 = ShapeElement.FindShapeField(shapeFields, "Title");
Decorator decorator1 = new ShapeDecorator(field1,
     ShapeDecoratorPosition.InnerTopCenter, PointD.Empty);
decorators.Add(decorator1);
}

.NET Framework Security

See Also

Reference

ShapeElement Class

Microsoft.VisualStudio.Modeling.Diagrams Namespace