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
- 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.
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
- 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.