Show / Hide Table of Contents

Class CompositeUserDataDescriptor

A user data descriptor which aggregates multiple descriptors and tries dispatching members on them, in order.

Used, for example, for objects implementing multiple interfaces but for which no descriptor is specifically registered.

Inheritance
System.Object
CompositeUserDataDescriptor
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public class CompositeUserDataDescriptor : IUserDataDescriptor

Constructors

CompositeUserDataDescriptor(List<IUserDataDescriptor>, Type)

Initializes a new instance of the CompositeUserDataDescriptor class.

Declaration
public CompositeUserDataDescriptor(List<IUserDataDescriptor> descriptors, Type type)
Parameters
List<IUserDataDescriptor> descriptors

The descriptors.

Type type

The type.

Properties

Descriptors

Gets the descriptors aggregated by this object, allowing changes to the descriptor list

Declaration
public IList<IUserDataDescriptor> Descriptors { get; }
Property Value
IList<IUserDataDescriptor>

Name

Gets the name of the descriptor (usually, the name of the type described).

Declaration
public string Name { get; }
Property Value
System.String

Implements
IUserDataDescriptor.Name

Type

Gets the type this descriptor refers to

Declaration
public Type Type { get; }
Property Value
Type

Implements
IUserDataDescriptor.Type

Methods

AsString(Object)

Converts this userdata to string

Declaration
public string AsString(object obj)
Parameters
System.Object obj

The object.

Returns
System.String

Implements
IUserDataDescriptor.AsString(Object)

Index(Script, Object, DynValue, Boolean)

Performs an "index" "get" operation.

Declaration
public DynValue Index(Script script, object obj, DynValue index, bool isNameIndex)
Parameters
Script script

The script originating the request

System.Object obj

The object (null if a static request is done)

DynValue index

The index.

System.Boolean isNameIndex

Returns
DynValue

Implements
IUserDataDescriptor.Index(Script, Object, DynValue, Boolean)

IsTypeCompatible(Type, Object)

Determines whether the specified object is compatible with the specified type. Unless a very specific behaviour is needed, the correct implementation is a simple " return type.IsInstanceOfType(obj); "

Declaration
public bool IsTypeCompatible(Type type, object obj)
Parameters
Type type

The type.

System.Object obj

The object.

Returns
System.Boolean

Implements
IUserDataDescriptor.IsTypeCompatible(Type, Object)

MetaIndex(Script, Object, String)

Gets a "meta" operation on this userdata. If a descriptor does not support this functionality, it should return "null" (not a nil). These standard metamethods can be supported (the return value should be a function accepting the classic parameters of the corresponding metamethod): __add, __sub, __mul, __div, __div, __pow, __unm, __eq, __lt, __le, __lt, __len, __concat, __pairs, __ipairs, __iterator, __call These standard metamethods are supported through other calls for efficiency: __index, __newindex, __tostring

Declaration
public DynValue MetaIndex(Script script, object obj, string metaname)
Parameters
Script script

The script originating the request

System.Object obj

The object (null if a static request is done)

System.String metaname

The name of the metamember.

Returns
DynValue

Implements
IUserDataDescriptor.MetaIndex(Script, Object, String)

SetIndex(Script, Object, DynValue, DynValue, Boolean)

Performs an "index" "set" operation.

Declaration
public bool SetIndex(Script script, object obj, DynValue index, DynValue value, bool isNameIndex)
Parameters
Script script

The script originating the request

System.Object obj

The object (null if a static request is done)

DynValue index

The index.

DynValue value

The value to be set

System.Boolean isNameIndex

Returns
System.Boolean

Implements
IUserDataDescriptor.SetIndex(Script, Object, DynValue, DynValue, Boolean)
Back to top Built by Itinero, MIT licensed.