Class EnumerableValueProvider
An implementation of IGetsValueFromObject which works for types which implement System.Collections.IEnumerable. This allows accessing their items by zero-based numeric index.
Inheritance
System.Object
EnumerableValueProvider
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ZptSharp.Expressions.PathExpressions
Assembly: ZptSharp.dll
Syntax
public class EnumerableValueProvider : IGetsValueFromObject
Constructors
| Improve this Doc View SourceEnumerableValueProvider(IGetsValueFromObject)
Initializes a new instance of the EnumerableValueProvider class.
Declaration
public EnumerableValueProvider(IGetsValueFromObject wrapped)
Parameters
Type | Name | Description |
---|---|---|
IGetsValueFromObject | wrapped | Wrapped. |
Methods
| Improve this Doc View SourceTryGetValueAsync(String, Object, CancellationToken)
Attempts to get a value for a named reference, from the specified object.
If the object implements System.Collections.IEnumerable and the name
is a valid
integer then an item will be returned from the zero-based index derived from the name.
Declaration
public Task<GetValueResult> TryGetValueAsync(string name, object object, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The value name. |
System.Object | object | The object from which to retrieve the value. |
System.Threading.CancellationToken | cancellationToken | An optional cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<GetValueResult> | An object indicating whether a value was successfully retrieved or not, along with the retrieved value (if applicable). |