DynamicJsonObject.TryGetIndex Method
Gets the value of a DynamicJsonObject field using the specified index.
Namespace: System.Web.Helpers
Assembly: System.Web.Helpers (in System.Web.Helpers.dll)
Syntax
'Declaration
Public Overrides Function TryGetIndex ( _
binder As GetIndexBinder, _
indexes As Object(), _
<OutAttribute> ByRef result As Object _
) As Boolean
'Usage
Dim instance As DynamicJsonObject
Dim binder As GetIndexBinder
Dim indexes As Object()
Dim result As Object
Dim returnValue As Boolean
returnValue = instance.TryGetIndex(binder, _
indexes, result)
public override bool TryGetIndex(
GetIndexBinder binder,
Object[] indexes,
out Object result
)
public:
virtual bool TryGetIndex(
GetIndexBinder^ binder,
array<Object^>^ indexes,
[OutAttribute] Object^% result
) override
abstract TryGetIndex :
binder:GetIndexBinder *
indexes:Object[] *
result:Object byref -> bool
override TryGetIndex :
binder:GetIndexBinder *
indexes:Object[] *
result:Object byref -> bool
public override function TryGetIndex(
binder : GetIndexBinder,
indexes : Object[],
result : Object
) : boolean
Parameters
- binder
Type: System.Dynamic.GetIndexBinder
Provides information about the indexed get operation.
- indexes
Type: System.Object[]
An array that contains a single object that indexes the field by name. The object must be convertible to a string that specifies the name of the JSON field to return. If multiple indexes are specified, result contains null reference (Nothing in Visual Basic) when this method returns.
- result
Type: System.Object%
When this method returns, contains the value of the indexed field, or null reference (Nothing in Visual Basic) if the get operation was unsuccessful. This parameter is passed uninitialized.
Return Value
Type: System.Boolean
true in all cases.
Remarks
Warning
If multiple indexes are specified by the indexes parameter, no field value is returned from the DynamicJsonObject instance, even if the indexes specify a valid field when considered individually. This error is not reported to your code.