Beispiel #1
0
        private static ITypeMember FindMember(IType type, MemberType kind, string name, IType[] types)
        {
            switch (kind)
            {
            case MemberType.Field:
                return(type.Fields[name]);

            case MemberType.Property:
            {
                var properties = type.Properties.Find(name);
                if (properties == null)
                {
                    return(null);
                }

                if (types == null || types.Length == 0)
                {
                    return(properties.FirstOrDefault());
                }

                return(properties.FirstOrDefault(p => Signature.CheckSignature(p, name, types)));
            }
            }

            return(null);
        }