示例#1
0
        public void SetMapping <TSource, TTarget>(Convert <object, object> function)
        {
            Type           sourceType = typeof(TSource);
            Type           targetType = typeof(TTarget);
            TypeMappingKey key        = new TypeMappingKey(sourceType, targetType);

            _internalDictionary[key] = function;
        }
示例#2
0
        public bool IsSupported <TSource, TTarget>()
        {
            Type           sourceType = typeof(TSource);
            Type           targetType = typeof(TTarget);
            TypeMappingKey key        = new TypeMappingKey(sourceType, targetType);

            return(_internalDictionary.ContainsKey(key));
        }
示例#3
0
        public Convert <object, object> GetMapping(Type sourceType, Type targetType)
        {
            TypeMappingKey key = new TypeMappingKey(sourceType, targetType);

            if (_internalDictionary.ContainsKey(key))
            {
                return(_internalDictionary[key]);
            }
            return(null);
        }
示例#4
0
        public void SetMapping(Type sourceType, Type targetType, Convert <object, object> function)
        {
            TypeMappingKey key = new TypeMappingKey(sourceType, targetType);

            _internalDictionary[key] = function;
        }
示例#5
0
        public bool IsSupported(Type sourceType, Type targetType)
        {
            TypeMappingKey key = new TypeMappingKey(sourceType, targetType);

            return(_internalDictionary.ContainsKey(key));
        }