Interface IDynamicAccessor
Defines an mechanism to access members (e.g. fields or properties) of objects in a consistent way.
Namespace: Ludiq.ReflectionMagic
Syntax
public interface IDynamicAccessor
Properties
Name
Gets the name of the property.
Declaration
string Name { get; }
Property Value
Type | Description |
---|---|
String |
PropertyType
Gets the type of the property.
Declaration
Type PropertyType { get; }
Property Value
Type | Description |
---|---|
Type |
Methods
GetValue(Object, Object[])
Returns the property value of a specified object with optional index values for indexed properties.
Declaration
object GetValue(object obj, object[] index)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | The object whose property value will be returned. |
Object[] | index | Optional index values for indexed properties. The indexes of indexed properties are zero-based. This value should be null for non-indexed properties. |
Returns
Type | Description |
---|---|
Object | The member value of the specified object. |
SetValue(Object, Object, Object[])
Sets the property value of a specified object with optional index values for index properties.
Declaration
void SetValue(object obj, object value, object[] index)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | The object whose property value will be set. |
Object | value | The new property value. |
Object[] | index | Optional index values for indexed properties. This value should be null for non-indexed properties. |