Show / Hide Table of Contents

Class CustomConvertersCollection

A collection of custom converters between MoonSharp types and CLR types. If a converter function is not specified or returns null, the standard conversion path applies.

Inheritance
System.Object
CustomConvertersCollection
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 CustomConvertersCollection

Methods

Clear()

Removes all converters.

Declaration
public void Clear()

GetClrToScriptCustomConversion(Type)

Gets a custom converter from a CLR data type, or null

Declaration
public Func<Script, object, DynValue> GetClrToScriptCustomConversion(Type clrDataType)
Parameters
Type clrDataType

Type of the color data.

Returns
Func<Script, System.Object, DynValue>

The converter function, or null if not found

GetScriptToClrCustomConversion(DataType, Type)

Gets a custom converter from a script data type to a CLR data type, or null

Declaration
public Func<DynValue, object> GetScriptToClrCustomConversion(DataType scriptDataType, Type clrDataType)
Parameters
DataType scriptDataType

The script data type

Type clrDataType

The CLR data type.

Returns
Func<DynValue, System.Object>

The converter function, or null if not found

SetClrToScriptCustomConversion(Type, Func<Script, Object, DynValue>)

Sets a custom converter from a CLR data type. Set null to remove a previous custom converter.

Declaration
public void SetClrToScriptCustomConversion(Type clrDataType, Func<Script, object, DynValue> converter = null)
Parameters
Type clrDataType

The CLR data type.

Func<Script, System.Object, DynValue> converter

The converter, or null.

SetClrToScriptCustomConversion(Type, Func<Object, DynValue>)

Declaration
public void SetClrToScriptCustomConversion(Type clrDataType, Func<object, DynValue> converter = null)
Parameters
Type clrDataType

Func<System.Object, DynValue> converter

SetClrToScriptCustomConversion<T>(Func<T, DynValue>)

Sets a custom converter from a CLR data type. Set null to remove a previous custom converter.

Declaration
public void SetClrToScriptCustomConversion<T>(Func<T, DynValue> converter = null)
Parameters
Func<T, DynValue> converter

The converter, or null.

Type Parameters
T

The CLR data type.

SetClrToScriptCustomConversion<T>(Func<Script, T, DynValue>)

Sets a custom converter from a CLR data type. Set null to remove a previous custom converter.

Declaration
public void SetClrToScriptCustomConversion<T>(Func<Script, T, DynValue> converter = null)
Parameters
Func<Script, T, DynValue> converter

The converter, or null.

Type Parameters
T

The CLR data type.

SetScriptToClrCustomConversion(DataType, Type, Func<DynValue, Object>)

Sets a custom converter from a script data type to a CLR data type. Set null to remove a previous custom converter.

Declaration
public void SetScriptToClrCustomConversion(DataType scriptDataType, Type clrDataType, Func<DynValue, object> converter = null)
Parameters
DataType scriptDataType

The script data type

Type clrDataType

The CLR data type.

Func<DynValue, System.Object> converter

The converter, or null.

Back to top Built by Itinero, MIT licensed.