ShapeElement Methods


Domain-Specific Language Tools Reference
ShapeElement.InitializeShapeFields Method

Initializes the fields assigned to the shape.

Namespace: Microsoft.VisualStudio.Modeling.Diagrams
Assembly: Microsoft.VisualStudio.Modeling.Sdk.Diagrams (in microsoft.visualstudio.modeling.diagrams.dll)

Syntax

Visual Basic (Declaration)
Protected Overridable Sub InitializeShapeFields ( _
	shapeFields As IList(Of ShapeField) _
)
Visual Basic (Usage)
Dim shapeFields As IList(Of ShapeField)

Me.InitializeShapeFields(shapeFields)
C#
protected virtual void InitializeShapeFields (
	IList<ShapeField> shapeFields
)
C++
protected:
virtual void InitializeShapeFields (
	IList<ShapeField^>^ shapeFields
)
J#
protected void InitializeShapeFields (
	IList<ShapeField> shapeFields
)
JScript
protected function InitializeShapeFields (
	shapeFields : IList<ShapeField>
)

Parameters

shapeFields

The fields assigned to the shape.

Remarks

You can override this method to add text, images, and other fields to the shape. Text can be added by initializing a text field (TextField), and images, by initializing an image field (ImageField). Both text fields and image fields are derived from the shape field (ShapeField).

Example

C#
protected override void InitializeDecorators(global::System.Collections.Generic.IList<DslDiagrams::ShapeField> shapeFields, global::System.Collections.Generic.IList<DslDiagrams::Decorator> decorators)
{
base.InitializeDecorators(shapeFields, decorators);

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

Tags :


Page view tracker