예제 #1
0
        public override bool Equals(object obj)
        {
            MethodCacheKey key = obj as MethodCacheKey;

            if (key != null &&
                key.TypeName == this.TypeName &&
                key.MethodName == this.MethodName &&
                ArrayEquals(key.ParamTypes, this.ParamTypes))
            {
                return(true);
            }

            return(false);
        }
예제 #2
0
        public static MethodCacheKey Create(string typeName, string methodName, Type[] paramTypes)
        {
            MethodCacheKey key = new MethodCacheKey();
            key.TypeName = typeName;
            key.MethodName = methodName;
            key.ParamTypes = paramTypes;

            key.HashKey = key.TypeName.GetHashCode();
            key.HashKey = key.HashKey ^ key.MethodName.GetHashCode();
            foreach (Type item in key.ParamTypes)
                key.HashKey = key.HashKey ^ item.Name.GetHashCode();

            return key;
        }
예제 #3
0
        public static MethodCacheKey Create(string typeName, string methodName, Type[] paramTypes)
        {
            MethodCacheKey key = new MethodCacheKey();

            key.TypeName   = typeName;
            key.MethodName = methodName;
            key.ParamTypes = paramTypes;

            key.HashKey = key.TypeName.GetHashCode();
            key.HashKey = key.HashKey ^ key.MethodName.GetHashCode();
            foreach (Type item in key.ParamTypes)
            {
                key.HashKey = key.HashKey ^ item.Name.GetHashCode();
            }

            return(key);
        }