ShapeElement.InitializeDecorators Method
Initializes and adds fields to the shape type.
Assembly: Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0.dll)
protected virtual void InitializeDecorators( IList<ShapeField> shapeFields, IList<Decorator> decorators )
Parameters
- shapeFields
- Type: System.Collections.Generic.IList<ShapeField>
The list of fields passed from the InitialiseShapeFields() method.
- decorators
- Type: System.Collections.Generic.IList<Decorator>
The list to which this method should add decorators.
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
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); }
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.