internal Converter(
     ConverterErrorStrategy errorStrategy,
     object defaultInputTypeValue,
     object defaultOutputTypeValue,
     [NotNull] Type inputType,
     [NotNull] Type outputType,
     bool isConvertFunctionAvailable,
     bool isConvertBackFunctionAvailable)
 {
     ErrorStrategy = errorStrategy;
     DefaultInputTypeValue = defaultInputTypeValue;
     DefaultOutputTypeValue = defaultOutputTypeValue;
     InputType = inputType;
     OutputType = outputType;
     IsConvertFunctionAvailable = isConvertFunctionAvailable;
     IsConvertBackFunctionAvailable = isConvertBackFunctionAvailable;
 }
Beispiel #2
0
 protected Converter(
     ConverterErrorStrategy errorStrategy,
     object?defaultInputTypeValue,
     object?defaultOutputTypeValue,
     Type inputType,
     Type outputType,
     bool isConvertFunctionAvailable,
     bool isConvertBackFunctionAvailable)
 {
     ErrorStrategy          = errorStrategy;
     DefaultInputTypeValue  = defaultInputTypeValue;
     DefaultOutputTypeValue = defaultOutputTypeValue;
     InputType  = inputType;
     OutputType = outputType;
     IsConvertFunctionAvailable     = isConvertFunctionAvailable;
     IsConvertBackFunctionAvailable = isConvertBackFunctionAvailable;
 }
Beispiel #3
0
 internal Converter(
     ConverterErrorStrategy errorStrategy,
     object defaultInputTypeValue,
     object defaultOutputTypeValue,
     [NotNull] Type inputType,
     [NotNull] Type outputType,
     bool isConvertFunctionAvailable,
     bool isConvertBackFunctionAvailable)
 {
     ErrorStrategy          = errorStrategy;
     DefaultInputTypeValue  = defaultInputTypeValue;
     DefaultOutputTypeValue = defaultOutputTypeValue;
     InputType  = inputType;
     OutputType = outputType;
     IsConvertFunctionAvailable     = isConvertFunctionAvailable;
     IsConvertBackFunctionAvailable = isConvertBackFunctionAvailable;
 }
 protected Converter(
     ConverterErrorStrategy errorStrategy,
     object?defaultInputTypeValue,
     object?defaultOutputTypeValue,
     Type inputType,
     Type outputType,
     bool isConvertFunctionAvailable,
     bool isConvertBackFunctionAvailable)
     : base(
         errorStrategy,
         defaultInputTypeValue,
         defaultOutputTypeValue,
         inputType,
         outputType,
         isConvertFunctionAvailable,
         isConvertBackFunctionAvailable)
 {
 }
        public static IMultiValueConverter Create <I, O, P>(
            Func <MultiValueConverterArgs <I, P>, O> convertFunction = null,
            Func <ValueConverterArgs <O, P>, IEnumerable <I> > convertBackFunction = null,
            ConverterErrorStrategy errorStrategy = ConverterErrorStrategy.ReturnDefaultValue)
        {
            switch (errorStrategy)
            {
            case ConverterErrorStrategy.ReturnDefaultValue:
            case ConverterErrorStrategy.UseFallbackOrDefaultValue:
            case ConverterErrorStrategy.DoNothing:
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(errorStrategy));
            }

            return(new Converter <I, O, P>(convertFunction, convertBackFunction, errorStrategy));
        }
 internal Converter(
     Func <ValueConverterArgs <I, P>, O>?convertFunction,
     Func <ValueConverterArgs <O, P>, I>?convertBackFunction,
     ConverterErrorStrategy errorStrategy)
     : base(errorStrategy, default(I) !, default(O) !, typeof(I), typeof(O), convertFunction != null, convertBackFunction != null)