Beispiel #1
0
        internal static ExactConvertor _GetConvertor(Type FromType, Type ToType)
        {
Again:
            var Key = new ExactConvertor(FromType, ToType);

            if (ExactConvertors.TryGetValue(Key, out var Result) == false)
            {
                var ConvertorType = typeof(Convertor <,>).MakeGenericType(FromType, ToType);
                ConvertorType.GetMethod("Safe").Invoke(null, null);
                goto Again;
            }
            else
            {
                return(Result);
            }
        }
Beispiel #2
0
        internal static ExactConvertor GetConvertor(Type Type)
        {
Again:
            var Key = new ExactConvertor()
            {
                HashCode = Type.GetHashCode(), Type = Type
            };

            if (ExactConvertors.TryGetValue(Key, out var Result) == false)
            {
                typeof(ConvertorToString <>).MakeGenericType(Type).
                GetMethod("Safe").Invoke(null, null);
                goto Again;
            }
            else
            {
                return(Result);
            }
        }