Ejemplo n.º 1
0
        protected override MethodInfo SelectMember(Type type, InjectionMember _)
        {
            var noData = 0 == (Data?.Length ?? 0);

            foreach (var member in DeclaredMembers(type))
            {
                if (null != Name)
                {
                    if (Name != member.Name)
                    {
                        continue;                      // TODO: redundant check. Remove!
                    }
                    if (noData)
                    {
                        return(member);
                    }
                }

                if (!Data.MatchMemberInfo(member))
                {
                    continue;
                }

                return(member);
            }

            throw new ArgumentException(NoMatchFound);
        }
Ejemplo n.º 2
0
        protected override TMemberInfo SelectMember(Type type, InjectionMember _)
        {
            foreach (var member in DeclaredMembers(type))
            {
                if (member.Name != Name)
                {
                    continue;
                }

                return(member);
            }

            throw new ArgumentException(NoMatchFound);
        }
        protected override ConstructorInfo SelectMember(Type type, InjectionMember _)
        {
            foreach (var member in DeclaredMembers(type))
            {
                if (!Data.MatchMemberInfo(member))
                {
                    continue;
                }

                return(member);
            }

            throw new ArgumentException(NoMatchFound);
        }