DynamicValueTryGetIndex Method

Provides the implementation for operations that get a value by index. Classes derived from the DynamicObject class can override this method to specify dynamic behavior for indexing operations.


Namespace: TwinCAT.TypeSystem
Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll) Version: 7.0.0+e56d35ccc4675faac24789a4aab60071fc61d470

Syntax

C#

public override bool TryGetIndex(
    GetIndexBinder binder,
    Object[] indexes,
    out Object?? result
)

Parameters

binder  GetIndexBinder

Provides information about the operation.

indexes  Object

The indexes that are used in the operation. For example, for the sampleObject[3] operation in C# (sampleObject(3) in Visual Basic), where sampleObject is derived from the DynamicObject class, indexes[0] is equal to 3.

result  Object

The result of the index operation.

Return Value

Boolean
true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.)

Reference

DynamicValue Class TwinCAT.TypeSystem Namespace

Beckhoff Automation GmbH & Co. KG 2001-2026