9 namespace Core.TypeCast.Base
14 using System.Reflection;
15 using System.Runtime.Serialization;
26 return this.Create(method, null);
39 public override Converter Create(MethodInfo methodInfo,
object converterDelegate = null)
41 if(methodInfo == null && converterDelegate == null)
46 var parameterInfos = methodInfo.GetParameters();
48 if(parameterInfos.Length == 0)
53 bool isInstanceMethod = converterDelegate == null;
62 if(parameterInfos.Length == 2 || isInstanceMethod ==
true)
64 converter = Instantiate<Converter>(typeof(
Converter<,,>), parameters: parameterTypes.ToArray(), args:
new[] { converterDelegate ?? methodInfo, parameterTypes.Arg });
69 else if(parameterInfos.Length == 1)
71 converter = Instantiate<Converter>(typeof(
Converter<,>), parameters:
new[] { parameterTypes.In, parameterTypes.Out }, args: converterDelegate);
79 converter.MergeFromMethodAttribute(methodInfo);
ConverterMethodAttribute FunctionAttribute
Gets an instance of ConverterMethodAttribute of the Function if it exists. May also be null if the at...
ConverterMethodAttribute FunctionDefaultAttribute
Gets an instance of ConverterMethodAttribute of the FunctionDefault if it exists. May also be null if...
Use ConverterMethodAttribute to declare a method in an arbitrary class as a logical Converter functio...
The Exception-type which is raised exclusively by the Converter<TIn,TOut> Library ...
Creates new instances of Converter<TIn, TOut> or Converter<TIn, TOut, TArg> dependent on the number o...
The abstract generic factory for creating arbitrary instances requiring up to two arguments...
override Converter Create(MethodInfo methodInfo, object converterDelegate=null)
Creates a strictly typed Converter<TIn, TOut, TArg> container in case of any attribute-assigned metho...
Container with sequentially assigned type-parameters of a strictly typed Converter-Function, in the sequence of Types for: In, Out, Argument
override Converter Create(MethodInfo method)
ConverterCause
Contains the reasons for a ConverterException to be raised.
The Converter base class, providing a simple container for conversion types, ConverterAttribute and c...