コード例 #1
0
        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;
        }
コード例 #2
0
ファイル: Action.cs プロジェクト: somelou/Randoop.NET
        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));
        }
コード例 #3
0
        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);
        }