public static PrimitiveValueTransformer Get(Type type, object value)
        {
            //if (ReflectionUtils.IsStaticClass(type))
            //{
            //    throw new ArgumentException("Type is static class: " + type.ToString());
            //}

            TypeValuePair p = new TypeValuePair(type, value);
            PrimitiveValueTransformer t;
            cachedTransformers.TryGetValue(p, out t);
            if (t == null)
                cachedTransformers[p] = t = new PrimitiveValueTransformer(type, value);

            return t;
        }
Example #2
0
        public override bool Equals(object obj)
        {
            TypeValuePair other = obj as TypeValuePair;

            if (obj == null)
            {
                return(false);
            }

            if (!this.type.Equals(other.type))
            {
                return(false);
            }

            return(Util.SafeEqual(this.value, other.value));
        }
        public static PrimitiveValueTransformer Get(Type type, object value)
        {
            //if (ReflectionUtils.IsStaticClass(type))
            //{
            //    throw new ArgumentException("Type is static class: " + type.ToString());
            //}

            TypeValuePair             p = new TypeValuePair(type, value);
            PrimitiveValueTransformer t;

            cachedTransformers.TryGetValue(p, out t);
            if (t == null)
            {
                cachedTransformers[p] = t = new PrimitiveValueTransformer(type, value);
            }

            return(t);
        }