Ejemplo n.º 1
0
        private static InternalMethodCallback CreateMultiMethod(TypeRegistry registry,
                                                                Type type,
                                                                string name)
        {
            var methods = type.GetMembers(BindingFlags.Public | BindingFlags.Static)
                          .Where(p => p.Name == name && p.MemberType == MemberTypes.Method)
                          .Select(p => (MethodInfo)p);

            return(MethodWrapper.Create(registry, methods, null));
        }
Ejemplo n.º 2
0
        private static InternalMethodCallback CreateMultiMethod(TypeRegistry registry,
                                                                Type type,
                                                                object self,
                                                                string name)
        {
            var methods = type.GetMembers(BindingFlags.Public | BindingFlags.Instance)
                          .Where(p => p.Name == name && p.MemberType == MemberTypes.Method)
                          .Select(p => (MethodInfo)p);

            if (methods.Count() > 1)
            {
                return(MethodWrapper.Create(registry, methods, self));
            }
            else
            {
                return(MethodWrapper.Create(registry, methods.First(), self));
            }
        }