private static MatchFunction GetMatchFunction(MethodForm methodForm) { MatchFunction matchFunction; switch (methodForm) { case MethodForm.Getter: matchFunction = new MatchFunction(RegexUtils.MatchGetPropertyName); break; case MethodForm.Setter: matchFunction = new MatchFunction(RegexUtils.MatchSetPropertyName); break; default: matchFunction = null; break; } return(matchFunction.RequiredNotNull()); }
private PropertyMember MatchToPropertyMember(string name, string fullName, MatchFunction matchFunction) { try { var accessedMemberName = matchFunction.MatchNameFunction(name); if (accessedMemberName != null) { var foundNameMatches = _type.GetPropertyMembersWithName(accessedMemberName).SingleOrDefault(); if (foundNameMatches != null) { return(foundNameMatches); } } } catch (InvalidOperationException) { } var accessedMemberFullName = matchFunction.MatchNameFunction(fullName); return(accessedMemberFullName != null ? GetPropertyMemberWithFullNameEndingWith(_type, accessedMemberFullName) : null); }