.NET Portable TypeCast  3.1.0.4
A, easy-to-use tested, generic, portable, runtime-extensible, arbitrary type converter library
ConverterCause.cs
Go to the documentation of this file.
1 // <copyright file=mitlicense.md url=http://lsauer.mit-license.org/ >
2 // Lo Sauer, 2013-2016
3 // </copyright>
4 // <summary> A tested, generic, portable, runtime-extensible type converter library </summary
5 // <language> C# > 6.0 </language>
6 // <version> 3.1.0.2 </version>
7 // <author> Lorenz Lo Sauer; people credited in the sources </author>
8 // <project> https://github.com/lsauer/dotnet-portable-type-cast </project>
9 namespace Core.TypeCast
10 {
11  using System;
12  using System.Collections.Concurrent;
13 
14  using Core.Extensions;
15  using Core.TypeCast.Base;
16 
20  public enum ConverterCause : ulong
21  {
25  [Description("Indicates the default or unspecified value")]
26  None = 0,
27 
31  [Description("Indicates the default or unspecified value")]
32  Unknown = 1 << 0,
33 
37  [Description("Indicates the default or unspecified value")]
38  Default = 1 << 1,
39 
43  [Description("Indicates that the Converter function is not set and null")]
44  ConverterFunctionNull = 1 << 2,
45 
49  [Description("Indicates that the Converter or an passed argument to the converter is `null`")]
50  ConverterArgumentNull = 1 << 3,
51 
55  [Description("Indicates a generic input type was passed, whilst being explicitly disallowed in the ConverterCollectionSettings instance")]
57 
61  [Description("Indicates that a Converter method got passed an argument of a Type `T` that does not match TIn or TOut respectively")]
63 
67  [Description("Indicates that the Converter, defined by the Input and Output conversion Types TIn --> TOut already exists")]
68  ConverterExists = 1 << 6,
69 
73  [Description("Indicates that the convert method failed near or at the custom convert Function invocation ")]
74  ConvertFailed = 1 << 7,
75 
80  [Description("Indicates that the custom converter function wrapper yielded an error")]
81  ConverterWrapperError = 1 << 8,
82 
87  [Description("Indicates an internal error state that may be specified further in the InnerException property")]
88  InternalError = 1 << 9,
89 
94  [Description("Indicates that a conversion related class constructor was injected with an argument that is null")]
95  ConstructorInjectionNull = 1 << 10,
96 
102  [Description("The converter could not be added to the ConverterCollection")]
103  ConverterCollectionAddFailed = 1 << 11,
104 
109  [Description("Indicates that the constructor of a conversion-related class requires parameters for proper instancing, yet was invoked parameterless.")]
110  InstanceRequiresParameters = 1 << 12,
111 
116  [Description("Indicates that a method in a converter or conversion-related class instance does not possess a logical implementation.")]
117  ConverterNotImplemented = 1 << 13,
118 
122  [Description("Indicates that the conversion source type is set to object, which is not sensible. Omit setting both target type parameters instead")]
124 
128  [Description("Indicates that passed converter function takes too many parameters. A maximum of two is permitted.")]
130 
134  [Description("Indicates that the passed converter function takes no parameters. At least one up two a maximum of two is required.")]
136 
140  [Description("Indicates that the reflection of the loading assembly failed, likely due to changes or security fixes for newer portable library class releases")]
142 
146  [Description("Indicates that the source and target types do not match. If they do not match use other functions instead, like CastTo and ConvertTo.")]
148 
152  [Description("Indicates that the cast failed, likely due to a missing converter. These exceptions can be suppressed with a function argument.")]
153  InvalidCast = 1 << 19,
154 
158  [Description("Indicates that the argument types of a given delegate do not match the return type and / or types of the provided parameters.")]
159  DelegateArgumentWrongType = 1 << 20,
160 
161 
165  [Description("Indicates that the converter logic raised an `InvalidOperationException`, `OverflowException` or `ArithmeticException` which was caught.")]
166  LogicError = 1 << 21,
167 
171  [Description("Indicates that the input argument was badly formatted.")]
172  BadInputFormat = 1 << 21,
173 
179  [Description("Indicates a null-reference for an existing Converter default function")]
181  }
182 }
Indicates that a method in a converter or conversion-related class instance does not possess a logica...
Indicates that the constructor of a parent Converter<TIn, TOut> class T requires parameters for prope...
Indicates the default or unspecified value
The Converter could not be added to the ConverterCollection
Indicates an unknown or undefined flag
Indicates that passed converter function takes too many parameters. A maximum of two is permitted...
Indicates that the argument types of a given delegate do not match the return type and / or types of ...
Indicates that the input argument was badly formatted.
Dependency Injection failed due to a null reference
Indicates that the Converter<TIn, TOut> or an passed argument to a Converter method is null ...
Indicates an internal error state that may be specified further in the Exception.InnerException prope...
Indicates a generic input type Converter.From was passed, whilst being explicitly disallowed in the C...
Indicates a default or normal flag
Indicates that the source and target types do not match. If they do not match use other functions ins...
Indicates that the conversion source type is set to object, which is not sensible. Omit setting both target type parameters instead
Indicates that the converter logic raised an InvalidOperationException, OverflowException or Arithmet...
Indicates that the passed converter function takes no parameters. At least one up two a maximum of tw...
Indicates that the reflection of the loading assembly failed, likely due to changes or security fixes...
Indicates that the Converter<TIn,TOut>.Convert(object,object) method failed near or at the custom con...
Indicates that a Converter<TIn, TOut> method got passed an argument of a System.TypeT that does not m...
Indicates that the Converter.Function property is not set and null
Indicates that the Converter<TIn, TOut>, defined by the Input and Output conversion Types TIn --> TOu...
Indicates that the custom converter function wrapper yielded an error
Indicates a null-reference for an existing Converter default function
Indicates that the cast failed, likely due to a missing converter. These exceptions can be suppressed...
ConverterCause
Contains the reasons for a ConverterException to be raised.