Show / Hide Table of Contents

Class PropertyTableAssigner<T>

Utility class which may be used to set properties on an object of type T, from values contained in a Lua table. Properties must be decorated with the MoonSharpPropertyAttribute. This is a generic version of PropertyTableAssigner.

Inheritance
System.Object
PropertyTableAssigner<T>
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 PropertyTableAssigner<T> : IPropertyTableAssigner
Type Parameters
T

The type of the object.

Constructors

PropertyTableAssigner(String[])

Initializes a new instance of the PropertyTableAssigner<T> class.

Declaration
public PropertyTableAssigner(params string[] expectedMissingProperties)
Parameters
System.String[] expectedMissingProperties

The expected missing properties, that is expected fields in the table with no corresponding property in the object.

Methods

AddExpectedMissingProperty(String)

Adds an expected missing property, that is an expected field in the table with no corresponding property in the object.

Declaration
public void AddExpectedMissingProperty(string name)
Parameters
System.String name

The name.

AssignObject(T, Table)

Assigns properties from tables to an object.

Declaration
public void AssignObject(T obj, Table data)
Parameters
T obj

The object.

Table data

The table.

Exceptions
System.ArgumentNullException

Object is null

ScriptRuntimeException

A field does not correspond to any property and that property is not one of the expected missing ones.

GetTypeUnsafeAssigner()

Gets the type-unsafe assigner corresponding to this object.

Declaration
public PropertyTableAssigner GetTypeUnsafeAssigner()
Returns
PropertyTableAssigner

SetSubassigner<SubassignerType>(PropertyTableAssigner<SubassignerType>)

Sets the subassigner for the given type

Declaration
public void SetSubassigner<SubassignerType>(PropertyTableAssigner<SubassignerType> assigner)
Parameters
PropertyTableAssigner<SubassignerType> assigner

The property assigner.

Type Parameters
SubassignerType

Type of the property for which the subassigner will be used.

SetSubassignerForType(Type, IPropertyTableAssigner)

Sets the subassigner for the given type. Pass null to remove usage of subassigner for the given type.

Declaration
public void SetSubassignerForType(Type propertyType, IPropertyTableAssigner assigner)
Parameters
Type propertyType

Type of the property for which the subassigner will be used.

IPropertyTableAssigner assigner

The property assigner.

Explicit Interface Implementations

IPropertyTableAssigner.AssignObjectUnchecked(Object, Table)

Assigns the properties of the specified object without checking the type.

Declaration
void IPropertyTableAssigner.AssignObjectUnchecked(object o, Table data)
Parameters
System.Object o

The object.

Table data

The data.

Implements
IPropertyTableAssigner.AssignObjectUnchecked(Object, Table)
Back to top Built by Itinero, MIT licensed.