Class ManualTypeDescriber
An ITypeDescriber that takes lets you register explicit members to return
when one of the EnumerateXXX() methods are called.
Inheritance
System.Object
ManualTypeDescriber
Namespace: Cesil
Assembly: Cesil.dll
Syntax
public sealed class ManualTypeDescriber : Object, ITypeDescriber, IEquatable<ManualTypeDescriber>
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
EnumerateMembersToDeserialize(TypeInfo)
Enumerate all the members on forType to deserialize.
If no members has been registered, will either delegate to a fallback
ITypeProvider or throw an exception depending on configuration.
Declaration
public IEnumerable<DeserializableMember> EnumerateMembersToDeserialize(TypeInfo forType)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
Returns
EnumerateMembersToSerialize(TypeInfo)
Enumerate all the members on forType to serialize.
If no members has been registered, will either delegate to a fallback
ITypeProvider or throw an exception depending on configuration.
Declaration
public IEnumerable<SerializableMember> EnumerateMembersToSerialize(TypeInfo forType)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
Returns
Equals(ManualTypeDescriber)
Returns true if this ManualTypeDescriber equals the given ManualTypeDescriber.
Declaration
public bool Equals(ManualTypeDescriber typeDescriber)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Equals(Object)
Returns true if this ManualTypeDescriber equals the given object
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
GetCellsForDynamicRow(WriteContext, Object, Span<DynamicCellValue>)
Operation not supported, raises exception if used.
Declaration
public int GetCellsForDynamicRow(in WriteContext context, object row, Span<DynamicCellValue> cells)
Parameters
Returns
Type |
Description |
System.Int32 |
|
GetDynamicCellParserFor(ReadContext, TypeInfo)
Operation not supported, raises exception if used.
Declaration
public Parser GetDynamicCellParserFor(in ReadContext context, TypeInfo targetType)
Parameters
Type |
Name |
Description |
ReadContext |
context |
|
System.Reflection.TypeInfo |
targetType |
|
Returns
GetDynamicRowConverter(ReadContext, IEnumerable<ColumnIdentifier>, TypeInfo)
Operation not supported, raises exception if used.
Declaration
public DynamicRowConverter GetDynamicRowConverter(in ReadContext context, IEnumerable<ColumnIdentifier> columns, TypeInfo targetType)
Parameters
Type |
Name |
Description |
ReadContext |
context |
|
System.Collections.Generic.IEnumerable<ColumnIdentifier> |
columns |
|
System.Reflection.TypeInfo |
targetType |
|
Returns
GetHashCode()
Returns a stable hash for this ManualTypeDescriber.
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
GetInstanceProvider(TypeInfo)
Returns the registered InstanceProvider for the given TypeInfo.
If no provider has been registered, will either delegate to a fallback
ITypeProvider or throw an exception depending on configuration.
Declaration
public InstanceProvider GetInstanceProvider(TypeInfo forType)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
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 |
|
Operators
Equality(ManualTypeDescriber, ManualTypeDescriber)
Compare two ManualTypeDescriber for equality
Declaration
public static bool operator ==(ManualTypeDescriber a, ManualTypeDescriber b)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Inequality(ManualTypeDescriber, ManualTypeDescriber)
Compare two ManualTypeDescriber for inequality
Declaration
public static bool operator !=(ManualTypeDescriber a, ManualTypeDescriber b)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Explicit Interface Implementations
ITypeDescriber.GetCellsForDynamicRow(WriteContext, Object, Span<DynamicCellValue>)
Declaration
int ITypeDescriber.GetCellsForDynamicRow(in WriteContext context, object row, Span<DynamicCellValue> cells)
Parameters
Returns
Type |
Description |
System.Int32 |
|
ITypeDescriber.GetDynamicCellParserFor(ReadContext, TypeInfo)
Declaration
Parser ITypeDescriber.GetDynamicCellParserFor(in ReadContext context, TypeInfo targetType)
Parameters
Type |
Name |
Description |
ReadContext |
context |
|
System.Reflection.TypeInfo |
targetType |
|
Returns
ITypeDescriber.GetDynamicRowConverter(ReadContext, IEnumerable<ColumnIdentifier>, TypeInfo)
Declaration
DynamicRowConverter ITypeDescriber.GetDynamicRowConverter(in ReadContext context, IEnumerable<ColumnIdentifier> columns, TypeInfo targetType)
Parameters
Type |
Name |
Description |
ReadContext |
context |
|
System.Collections.Generic.IEnumerable<ColumnIdentifier> |
columns |
|
System.Reflection.TypeInfo |
targetType |
|
Returns
Implements
System.IEquatable<>