示例#1
0
        private static MethodInfo GetMethodOnTypeThatWillBeInvokedByMethodInfo(Type type, MethodInfo method)
        {
            MethodInfo result = null;
            var        key    = new TypeMethodInfoPair {
                Type = type, MethodInfo = method
            };

            if (!methodCache.TryGetValue(key, out result))
            {
                result = FindMethodOnTypeThatWillBeInvokedByMethodInfo(type, method);
                methodCache.Add(key, result);
            }

            return(result);
        }
        public virtual MethodInfo GetMethodOnTypeThatWillBeInvokedByMethodInfo(Type type, MethodInfo method)
        {
            MethodInfo result = null;
            var key = new TypeMethodInfoPair { Type = type, MethodInfo = method };

            lock (MethodCache)
            {
                if (!MethodCache.TryGetValue(key, out result))
                {
                    result = FindMethodOnTypeThatWillBeInvokedByMethodInfo(type, method);
                    MethodCache.Add(key, result);
                }
            }

            return result;
        }
示例#3
0
        public virtual MethodInfo GetMethodOnTypeThatWillBeInvokedByMethodInfo(Type type, MethodInfo method)
        {
            MethodInfo result = null;
            var        key    = new TypeMethodInfoPair {
                Type = type, MethodInfo = method
            };

            lock (MethodCache)
            {
                if (!MethodCache.TryGetValue(key, out result))
                {
                    result = FindMethodOnTypeThatWillBeInvokedByMethodInfo(type, method);
                    MethodCache.Add(key, result);
                }
            }

            return(result);
        }
        public virtual MethodInfo GetMethodOnTypeThatWillBeInvokedByMethodInfo(Type type, MethodInfo method)
        {
            var key = new TypeMethodInfoPair(type, method);

            return MethodCache.GetOrAdd(key, k => FindMethodOnTypeThatWillBeInvokedByMethodInfo(k.Type, k.MethodInfo));
        }
        public virtual MethodInfo?GetMethodOnTypeThatWillBeInvokedByMethodInfo(Type type, MethodInfo method)
        {
            var key = new TypeMethodInfoPair(type, method);

            return(MethodCache.GetOrAdd(key, k => FindMethodOnTypeThatWillBeInvokedByMethodInfo(k.Type, new FakeItEasy.Compatibility.MethodInfoWrapper(k.MethodInfo, k.Type))));
        }
示例#6
0
        public virtual MethodInfo GetMethodOnTypeThatWillBeInvokedByMethodInfo(Type type, MethodInfo method)
        {
            var key = new TypeMethodInfoPair(type, method);

            return(MethodCache.GetOrAdd(key, k => FindMethodOnTypeThatWillBeInvokedByMethodInfo(k.Type, k.MethodInfo)));
        }
示例#7
0
        public virtual MethodInfo GetMethodOnTypeThatWillBeInvokedByMethodInfo(Type type, MethodInfo method)
        {
            var key = new TypeMethodInfoPair(type, method);

            return MethodCache.GetOrAdd(key, k => FindMethodOnTypeThatWillBeInvokedByMethodInfo(k.Type, new FakeItEasy.Compatibility.MethodInfoWrapper(k.MethodInfo, k.Type)));
        }