Searches for a shape field in a shape.
Namespace: Microsoft.VisualStudio.Modeling.Diagrams
Assembly: Microsoft.VisualStudio.Modeling.Sdk.Diagrams (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.dll)
Syntax
'宣言
Public Shared Function FindShapeField ( _
shapeFields As IList(Of ShapeField), _
fieldName As String _
) As ShapeField
'使用
Dim shapeFields As IList(Of ShapeField)
Dim fieldName As String
Dim returnValue As ShapeField
returnValue = ShapeElement.FindShapeField(shapeFields, _
fieldName)
public static ShapeField FindShapeField(
IList<ShapeField> shapeFields,
string fieldName
)
public:
static ShapeField^ FindShapeField(
IList<ShapeField^>^ shapeFields,
String^ fieldName
)
public static function FindShapeField(
shapeFields : IList<ShapeField>,
fieldName : String
) : ShapeField
Parameters
shapeFields
Type: System.Collections.Generic.IList<ShapeField>The shape fields in which to search.
fieldName
Type: System.StringThe name of the shape field.
Return Value
Type: Microsoft.VisualStudio.Modeling.Diagrams.ShapeField
The first shape field that has the specified name; otherwise, a null reference (Nothing in Visual Basic), if no shape field is found.
Examples
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);
}
Permissions
- 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.