Class ManualTypeDescriberBuilder
Builder for creating a ManualTypeDescriber.
Creates ITypeDescribers explicitly registered members to return
when one of the EnumerateXXX() methods are called.
Inheritance
System.Object
ManualTypeDescriberBuilder
Namespace: Cesil
Assembly: Cesil.dll
Syntax
public sealed class ManualTypeDescriberBuilder : Object
Properties
FallbackBehavior
The configured behavior to use when a type has no registered members or providers (depending on the method invoked).
Declaration
public ManualTypeDescriberFallbackBehavior FallbackBehavior { get; }
Property Value
FallbackTypeDescriber
ITypeDescriber that is used to discover providers or enumerate members if no registration exists
and FallbackBehavior allows falling back.
Declaration
public ITypeDescriber FallbackTypeDescriber { get; }
Property Value
Methods
CreateBuilder()
Create a new ManualTypeDescriberBuilder which fallbacks to TypeDescribers.Default when a type with
no registered members is requested.
Declaration
public static ManualTypeDescriberBuilder CreateBuilder()
Returns
CreateBuilder(ManualTypeDescriber)
Create a new ManualTypeDescriberBuilder that copies it's
initial values from the given ManualTypeDescriber.
Declaration
public static ManualTypeDescriberBuilder CreateBuilder(ManualTypeDescriber typeDescriber)
Parameters
Returns
CreateBuilder(ManualTypeDescriberFallbackBehavior)
Create a new empty ManualTypeDescriberBuilder with the given fallback behavior, and a fallback ITypeDescriber of TypeDescribers.Default.
Declaration
public static ManualTypeDescriberBuilder CreateBuilder(ManualTypeDescriberFallbackBehavior fallbackBehavior)
Parameters
Returns
CreateBuilder(ManualTypeDescriberFallbackBehavior, ITypeDescriber)
Create a new empty ManualTypeDescriberBuilder with the given fallback behavior.
Declaration
public static ManualTypeDescriberBuilder CreateBuilder(ManualTypeDescriberFallbackBehavior fallbackBehavior, ITypeDescriber fallbackTypeDescriber)
Parameters
Returns
ToManualTypeDescriber()
Create a ManualTypeDescriber with the options configured with this builder.
Declaration
public ManualTypeDescriber ToManualTypeDescriber()
Returns
ToString()
Returns a representation of this ManualTypeDescriber object.
Only for debugging, this value is not guaranteed to be stable.
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
WithDeserializableField(FieldInfo)
Add a field to deserialize for the type which declares the field.
Declaration
public ManualTypeDescriberBuilder WithDeserializableField(FieldInfo field)
Parameters
Type |
Name |
Description |
System.Reflection.FieldInfo |
field |
|
Returns
WithDeserializableField(FieldInfo, String)
Add a field to deserialize with the given name - for the type which declares the field.
Declaration
public ManualTypeDescriberBuilder WithDeserializableField(FieldInfo field, string name)
Parameters
Type |
Name |
Description |
System.Reflection.FieldInfo |
field |
|
System.String |
name |
|
Returns
WithDeserializableField(FieldInfo, String, Parser)
Add a field to deserialize with the given name and parser - for the type which declares the field.
Declaration
public ManualTypeDescriberBuilder WithDeserializableField(FieldInfo field, string name, Parser parser)
Parameters
Type |
Name |
Description |
System.Reflection.FieldInfo |
field |
|
System.String |
name |
|
Parser |
parser |
|
Returns
WithDeserializableField(FieldInfo, String, Parser, MemberRequired)
Add a field to deserialize with the given name, parser, and whether the column is required - for the type which declares the field.
Declaration
public ManualTypeDescriberBuilder WithDeserializableField(FieldInfo field, string name, Parser parser, MemberRequired required)
Parameters
Type |
Name |
Description |
System.Reflection.FieldInfo |
field |
|
System.String |
name |
|
Parser |
parser |
|
MemberRequired |
required |
|
Returns
WithDeserializableField(FieldInfo, String, Parser, MemberRequired, Reset)
Add a field to deserialize with the given name, parser, whether the column is required, and a reset method - for the type which declares the field.
Declaration
public ManualTypeDescriberBuilder WithDeserializableField(FieldInfo field, string name, Parser parser, MemberRequired required, Reset reset)
Parameters
Returns
WithDeserializableField(TypeInfo, FieldInfo)
Add a field to deserialize for the given type.
Declaration
public ManualTypeDescriberBuilder WithDeserializableField(TypeInfo forType, FieldInfo field)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
System.Reflection.FieldInfo |
field |
|
Returns
WithDeserializableField(TypeInfo, FieldInfo, String)
Add a field to deserialize for the given type with the given name.
Declaration
public ManualTypeDescriberBuilder WithDeserializableField(TypeInfo forType, FieldInfo field, string name)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
System.Reflection.FieldInfo |
field |
|
System.String |
name |
|
Returns
WithDeserializableField(TypeInfo, FieldInfo, String, Parser)
Add a field to deserialize for the given type with the given name and parser.
Declaration
public ManualTypeDescriberBuilder WithDeserializableField(TypeInfo forType, FieldInfo field, string name, Parser parser)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
System.Reflection.FieldInfo |
field |
|
System.String |
name |
|
Parser |
parser |
|
Returns
WithDeserializableField(TypeInfo, FieldInfo, String, Parser, MemberRequired)
Add a field to deserialize for the given type with the given name, parser, and whether the column is required.
Declaration
public ManualTypeDescriberBuilder WithDeserializableField(TypeInfo forType, FieldInfo field, string name, Parser parser, MemberRequired required)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
System.Reflection.FieldInfo |
field |
|
System.String |
name |
|
Parser |
parser |
|
MemberRequired |
required |
|
Returns
WithDeserializableField(TypeInfo, FieldInfo, String, Parser, MemberRequired, Reset)
Add a field to deserialize for the given type with the given name, parser, whether the column is required, and a reset method.
Declaration
public ManualTypeDescriberBuilder WithDeserializableField(TypeInfo forType, FieldInfo field, string name, Parser parser, MemberRequired required, Reset reset)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
System.Reflection.FieldInfo |
field |
|
System.String |
name |
|
Parser |
parser |
|
MemberRequired |
required |
|
Reset |
reset |
|
Returns
WithDeserializableProperty(PropertyInfo)
Add a property to deserialize for the type which declares the property.
Declaration
public ManualTypeDescriberBuilder WithDeserializableProperty(PropertyInfo property)
Parameters
Type |
Name |
Description |
System.Reflection.PropertyInfo |
property |
|
Returns
WithDeserializableProperty(PropertyInfo, String)
Add a property to deserialize with the given name - for the type which declares the property.
Declaration
public ManualTypeDescriberBuilder WithDeserializableProperty(PropertyInfo property, string name)
Parameters
Type |
Name |
Description |
System.Reflection.PropertyInfo |
property |
|
System.String |
name |
|
Returns
WithDeserializableProperty(PropertyInfo, String, Parser)
Add a property to deserialize with the given name and parser - for the type which declares the property.
Declaration
public ManualTypeDescriberBuilder WithDeserializableProperty(PropertyInfo property, string name, Parser parser)
Parameters
Type |
Name |
Description |
System.Reflection.PropertyInfo |
property |
|
System.String |
name |
|
Parser |
parser |
|
Returns
WithDeserializableProperty(PropertyInfo, String, Parser, MemberRequired)
Add a property to deserialize with the given name, parser, and whether the column is required - for the type which declares the property.
Declaration
public ManualTypeDescriberBuilder WithDeserializableProperty(PropertyInfo property, string name, Parser parser, MemberRequired required)
Parameters
Type |
Name |
Description |
System.Reflection.PropertyInfo |
property |
|
System.String |
name |
|
Parser |
parser |
|
MemberRequired |
required |
|
Returns
WithDeserializableProperty(PropertyInfo, String, Parser, MemberRequired, Reset)
Add a property to deserialize with the given name, parser, whether the column is required, and a reset method - for the type which declares the property.
Declaration
public ManualTypeDescriberBuilder WithDeserializableProperty(PropertyInfo property, string name, Parser parser, MemberRequired required, Reset reset)
Parameters
Type |
Name |
Description |
System.Reflection.PropertyInfo |
property |
|
System.String |
name |
|
Parser |
parser |
|
MemberRequired |
required |
|
Reset |
reset |
|
Returns
WithDeserializableProperty(TypeInfo, PropertyInfo)
Add a property to deserialize for the given type.
Declaration
public ManualTypeDescriberBuilder WithDeserializableProperty(TypeInfo forType, PropertyInfo property)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
System.Reflection.PropertyInfo |
property |
|
Returns
WithDeserializableProperty(TypeInfo, PropertyInfo, String)
Add a property to deserialize for the given type with the given name.
Declaration
public ManualTypeDescriberBuilder WithDeserializableProperty(TypeInfo forType, PropertyInfo property, string name)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
System.Reflection.PropertyInfo |
property |
|
System.String |
name |
|
Returns
WithDeserializableProperty(TypeInfo, PropertyInfo, String, Parser)
Add a property to deserialize for the given type with the given name and parser.
Declaration
public ManualTypeDescriberBuilder WithDeserializableProperty(TypeInfo forType, PropertyInfo property, string name, Parser parser)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
System.Reflection.PropertyInfo |
property |
|
System.String |
name |
|
Parser |
parser |
|
Returns
WithDeserializableProperty(TypeInfo, PropertyInfo, String, Parser, MemberRequired)
Add a property to deserialize for the given type with the given name and parser and whether the column is required.
Declaration
public ManualTypeDescriberBuilder WithDeserializableProperty(TypeInfo forType, PropertyInfo property, string name, Parser parser, MemberRequired required)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
System.Reflection.PropertyInfo |
property |
|
System.String |
name |
|
Parser |
parser |
|
MemberRequired |
required |
|
Returns
WithDeserializableProperty(TypeInfo, PropertyInfo, String, Parser, MemberRequired, Reset)
Add a property to deserialize for the given type with the given name and parser, whether the column is required, and a reset method.
Declaration
public ManualTypeDescriberBuilder WithDeserializableProperty(TypeInfo forType, PropertyInfo property, string name, Parser parser, MemberRequired required, Reset reset)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
System.Reflection.PropertyInfo |
property |
|
System.String |
name |
|
Parser |
parser |
|
MemberRequired |
required |
|
Reset |
reset |
|
Returns
WithExplicitGetter(TypeInfo, String, Getter)
Add a getter for the given type, with the given name, using the given getter.
Declaration
public ManualTypeDescriberBuilder WithExplicitGetter(TypeInfo forType, string name, Getter getter)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
System.String |
name |
|
Getter |
getter |
|
Returns
Add a getter for the given type, with the given name, using the given getter, and formatter.
Declaration
public ManualTypeDescriberBuilder WithExplicitGetter(TypeInfo forType, string name, Getter getter, Formatter formatter)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
System.String |
name |
|
Getter |
getter |
|
Formatter |
formatter |
|
Returns
Add a getter for the given type, with the given name, using the given getter, formatter, and ShouldSerialize method.
Declaration
public ManualTypeDescriberBuilder WithExplicitGetter(TypeInfo forType, string name, Getter getter, Formatter formatter, ShouldSerialize shouldSerialize)
Parameters
Returns
Add a getter for the given type, with the given name, using the given getter, formatter, ShouldSerialize method, and whether to emit a default value.
Declaration
public ManualTypeDescriberBuilder WithExplicitGetter(TypeInfo forType, string name, Getter getter, Formatter formatter, ShouldSerialize shouldSerialize, EmitDefaultValue emitDefault)
Parameters
Returns
WithExplicitSetter(TypeInfo, String, Setter)
Add a setter for the given type, with the given name, using the given setter.
Declaration
public ManualTypeDescriberBuilder WithExplicitSetter(TypeInfo forType, string name, Setter setter)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
System.String |
name |
|
Setter |
setter |
|
Returns
WithExplicitSetter(TypeInfo, String, Setter, Parser)
Add a setter for the given type, with the given name, using the given setter and parser.
Declaration
public ManualTypeDescriberBuilder WithExplicitSetter(TypeInfo forType, string name, Setter setter, Parser parser)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
System.String |
name |
|
Setter |
setter |
|
Parser |
parser |
|
Returns
WithExplicitSetter(TypeInfo, String, Setter, Parser, MemberRequired)
Add a setter for the given type, with the given name, using the given setter, parser, and whether the column is required.
Declaration
public ManualTypeDescriberBuilder WithExplicitSetter(TypeInfo forType, string name, Setter setter, Parser parser, MemberRequired required)
Parameters
Returns
WithExplicitSetter(TypeInfo, String, Setter, Parser, MemberRequired, Reset)
Add a setter for the given type, with the given name, using the given setter, parser, whether the column is required, and a reset method.
Declaration
public ManualTypeDescriberBuilder WithExplicitSetter(TypeInfo forType, string name, Setter setter, Parser parser, MemberRequired required, Reset reset)
Parameters
Returns
WithFallbackBehavior(ManualTypeDescriberFallbackBehavior)
Sets the behavior to fallback to when a method has no registrations to return.
Declaration
public ManualTypeDescriberBuilder WithFallbackBehavior(ManualTypeDescriberFallbackBehavior fallbackBehavior)
Parameters
Returns
WithFallbackTypeDescriber(ITypeDescriber)
Sets the ITypeDescriber to fallback to, provided that FallbackBehavior allows falling back,
when a method has no registrations to return.
Declaration
public ManualTypeDescriberBuilder WithFallbackTypeDescriber(ITypeDescriber typeDescriber)
Parameters
Returns
WithInstanceProvider(InstanceProvider)
Set the delegate to use when constructing new instances of
type T.
Declaration
public ManualTypeDescriberBuilder WithInstanceProvider(InstanceProvider instanceProvider)
Parameters
Returns
WithInstanceProvider(TypeInfo, InstanceProvider)
Set the delegate to use when constructing new instances of
the given type.
Declaration
public ManualTypeDescriberBuilder WithInstanceProvider(TypeInfo forType, InstanceProvider instanceProvider)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
InstanceProvider |
instanceProvider |
|
Returns
WithSerializableField(FieldInfo)
Add a field to serialize for the type which declares the field.
Declaration
public ManualTypeDescriberBuilder WithSerializableField(FieldInfo field)
Parameters
Type |
Name |
Description |
System.Reflection.FieldInfo |
field |
|
Returns
WithSerializableField(FieldInfo, String)
Add a field to serialize with the given name - for the type which declares the field.
Declaration
public ManualTypeDescriberBuilder WithSerializableField(FieldInfo field, string name)
Parameters
Type |
Name |
Description |
System.Reflection.FieldInfo |
field |
|
System.String |
name |
|
Returns
Add a field to serialize with the given name and formatter - for the type which declares the field.
Declaration
public ManualTypeDescriberBuilder WithSerializableField(FieldInfo field, string name, Formatter formatter)
Parameters
Type |
Name |
Description |
System.Reflection.FieldInfo |
field |
|
System.String |
name |
|
Formatter |
formatter |
|
Returns
Add a field to serialize with the given name, formatter, and ShouldSerialize method - for the type which declares the field.
Declaration
public ManualTypeDescriberBuilder WithSerializableField(FieldInfo field, string name, Formatter formatter, ShouldSerialize shouldSerialize)
Parameters
Type |
Name |
Description |
System.Reflection.FieldInfo |
field |
|
System.String |
name |
|
Formatter |
formatter |
|
ShouldSerialize |
shouldSerialize |
|
Returns
Add a field to serialize with the given name, formatter, ShouldSerialize method, and whether to emit a default value - for the type which declares the field.
Declaration
public ManualTypeDescriberBuilder WithSerializableField(FieldInfo field, string name, Formatter formatter, ShouldSerialize shouldSerialize, EmitDefaultValue emitDefault)
Parameters
Returns
WithSerializableField(TypeInfo, FieldInfo)
Add a field to serialize for the given type.
Declaration
public ManualTypeDescriberBuilder WithSerializableField(TypeInfo forType, FieldInfo field)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
System.Reflection.FieldInfo |
field |
|
Returns
WithSerializableField(TypeInfo, FieldInfo, String)
Add a field to serialize for the given type, using the given name.
Declaration
public ManualTypeDescriberBuilder WithSerializableField(TypeInfo forType, FieldInfo field, string name)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
System.Reflection.FieldInfo |
field |
|
System.String |
name |
|
Returns
Add a field to serialize for the given type, using the given name and formatter.
Declaration
public ManualTypeDescriberBuilder WithSerializableField(TypeInfo forType, FieldInfo field, string name, Formatter formatter)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
System.Reflection.FieldInfo |
field |
|
System.String |
name |
|
Formatter |
formatter |
|
Returns
Add a field to serialize for the given type, using the given name, formatter, and ShouldSerialize method.
Declaration
public ManualTypeDescriberBuilder WithSerializableField(TypeInfo forType, FieldInfo field, string name, Formatter formatter, ShouldSerialize shouldSerialize)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
System.Reflection.FieldInfo |
field |
|
System.String |
name |
|
Formatter |
formatter |
|
ShouldSerialize |
shouldSerialize |
|
Returns
Add a field to serialize for the given type, using the given name, formatter, and ShouldSerialize method.
Declaration
public ManualTypeDescriberBuilder WithSerializableField(TypeInfo forType, FieldInfo field, string name, Formatter formatter, ShouldSerialize shouldSerialize, EmitDefaultValue emitDefault)
Parameters
Returns
WithSerializableProperty(PropertyInfo)
Add a property to serialize for the type which declares the property.
Declaration
public ManualTypeDescriberBuilder WithSerializableProperty(PropertyInfo property)
Parameters
Type |
Name |
Description |
System.Reflection.PropertyInfo |
property |
|
Returns
WithSerializableProperty(PropertyInfo, String)
Add a property to serialize with the given name - for the type which declares the property.
Declaration
public ManualTypeDescriberBuilder WithSerializableProperty(PropertyInfo property, string name)
Parameters
Type |
Name |
Description |
System.Reflection.PropertyInfo |
property |
|
System.String |
name |
|
Returns
Add a property to serialize with the given name and formatter - for the type which declares the property.
Declaration
public ManualTypeDescriberBuilder WithSerializableProperty(PropertyInfo property, string name, Formatter formatter)
Parameters
Type |
Name |
Description |
System.Reflection.PropertyInfo |
property |
|
System.String |
name |
|
Formatter |
formatter |
|
Returns
Add a property to serialize with the given name, formatter, and ShouldSerialize method - for the type which declares the property.
Declaration
public ManualTypeDescriberBuilder WithSerializableProperty(PropertyInfo property, string name, Formatter formatter, ShouldSerialize shouldSerialize)
Parameters
Type |
Name |
Description |
System.Reflection.PropertyInfo |
property |
|
System.String |
name |
|
Formatter |
formatter |
|
ShouldSerialize |
shouldSerialize |
|
Returns
Add a property to serialize with the given name, formatter, ShouldSerialize method, and whether to emit a default value - for the type which declares the property.
Declaration
public ManualTypeDescriberBuilder WithSerializableProperty(PropertyInfo property, string name, Formatter formatter, ShouldSerialize shouldSerialize, EmitDefaultValue emitDefault)
Parameters
Returns
WithSerializableProperty(TypeInfo, PropertyInfo)
Add a property to serialize for the given type.
Declaration
public ManualTypeDescriberBuilder WithSerializableProperty(TypeInfo forType, PropertyInfo property)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
System.Reflection.PropertyInfo |
property |
|
Returns
WithSerializableProperty(TypeInfo, PropertyInfo, String)
Add a property to serialize for the given type with the given name.
Declaration
public ManualTypeDescriberBuilder WithSerializableProperty(TypeInfo forType, PropertyInfo property, string name)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
System.Reflection.PropertyInfo |
property |
|
System.String |
name |
|
Returns
Add a property to serialize for the given type with the given name and formatter.
Declaration
public ManualTypeDescriberBuilder WithSerializableProperty(TypeInfo forType, PropertyInfo property, string name, Formatter formatter)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
System.Reflection.PropertyInfo |
property |
|
System.String |
name |
|
Formatter |
formatter |
|
Returns
Add a property to serialize for the given type with the given name, formatter, and ShouldSerialize method.
Declaration
public ManualTypeDescriberBuilder WithSerializableProperty(TypeInfo forType, PropertyInfo property, string name, Formatter formatter, ShouldSerialize shouldSerialize)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
System.Reflection.PropertyInfo |
property |
|
System.String |
name |
|
Formatter |
formatter |
|
ShouldSerialize |
shouldSerialize |
|
Returns
Add a property to serialize for the given type with the given name, formatter, ShouldSerialize method, and whether to emit a default value.
Declaration
public ManualTypeDescriberBuilder WithSerializableProperty(TypeInfo forType, PropertyInfo property, string name, Formatter formatter, ShouldSerialize shouldSerialize, EmitDefaultValue emitDefault)
Parameters
Returns