.NET Portable TypeCast
3.1.0.4
A, easy-to-use tested, generic, portable, runtime-extensible, arbitrary type converter library
|
Use ConverterAttribute to declare a class as a logical Type Converter. As such the only contingent declaration contract requirement is adherence to implement a public constructor which takes a IConverterCollection collection
parameter
More...
Public Member Functions | |
ConverterAttribute (string nameSpace="", string name="", bool loadOnDemand=false, bool dependencyInjection=false) | |
Initializes a new instance of the ConverterAttribute class, to declare a custom Converter More... | |
ConverterAttribute (string nameSpace, Enum name, bool loadOnDemand=false, bool dependencyInjection=false) | |
Properties | |
Guid | Id [get] |
Gets a unique ID of the converter based on an underlying Guid. More... | |
TypeInfo | BaseType [get, set] |
Gets or sets the base type i.e. the declaring type (see: Type.DeclaringType containing or declaring the converter-functions. More... | |
bool | DependencInjection [get, set] |
Gets or sets a value indicating whether dependency injection should be used during instancing of a new custom converter />. More... | |
Use ConverterAttribute to declare a class as a logical Type Converter. As such the only contingent declaration contract requirement is adherence to implement a public constructor which takes a IConverterCollection collection
parameter
The attribute provides collective initialization through the ConverterCollection class.
Example:
Definition at line 42 of file ConverterAttribute.cs.
Core.TypeCast.ConverterAttribute.ConverterAttribute | ( | string | nameSpace = "" , |
string | name = "" , |
||
bool | loadOnDemand = false , |
||
bool | dependencyInjection = false |
||
) |
Initializes a new instance of the ConverterAttribute class, to declare a custom Converter
loadOnDemand | Set to true to allow joint initialization by the lazy instancing of the ConverterCollection Core.Singleton |
nameSpace | The namespace as a string, ideally set via the nameof operator to group converters and enable lazy-loading upon first use. |
name | A custom label for the converter or null if none is set, particularly used for Transform function disambiguates (i.e. identical In/Out parameters) |
dependencyInjection | Whether the declaring converter class is instantiated via dependency Injection. |
Definition at line 51 of file ConverterAttribute.cs.
Core.TypeCast.ConverterAttribute.ConverterAttribute | ( | string | nameSpace, |
Enum | name, | ||
bool | loadOnDemand = false , |
||
bool | dependencyInjection = false |
||
) |
Definition at line 61 of file ConverterAttribute.cs.
|
getset |
Gets or sets the base type i.e. the declaring type (see: Type.DeclaringType containing or declaring the converter-functions.
Definition at line 75 of file ConverterAttribute.cs.
|
getset |
Gets or sets a value indicating whether dependency injection should be used during instancing of a new custom converter />.
Definition at line 80 of file ConverterAttribute.cs.
|
get |
Gets a unique ID of the converter based on an underlying Guid.
Definition at line 70 of file ConverterAttribute.cs.