public bool MatchesParameterTypes(RuntimeMember runtimeMember) {
     if (parameterTypes == null) return true;
     for (var i = 0; i < parameterCount; i++) {
         if (runtimeMember.GetParameterType(i) != parameterTypes[i]) return false;
     }
     return true;
 }
 bool Matches(RuntimeMember runtimeMember) {
     return
         specification.MatchesParameterCount(runtimeMember) &&
         specification.MatchesParameterTypes(runtimeMember) &&
         specification.MatchesParameterNames(runtimeMember);
 }
Exemple #3
0
 bool Matches(RuntimeMember runtimeMember)
 {
     if (!runtimeMember.MatchesParameterCount(parameterCount)) return false;
     if (parameterTypes != null) {
         for (int i = 0; i < parameterCount; i++) {
             if (runtimeMember.GetParameterType(i) != parameterTypes[i]) return false;
         }
     }
     if (parameterIdNames != null) {
         foreach (var name in parameterIdNames) {
             if (!HasMatchingParameter(runtimeMember, name)) return false;
         }
     }
     return true;
 }
Exemple #4
0
 bool HasMatchingParameter(RuntimeMember runtimeMember, NameMatcher name)
 {
     for (int i = 0; i < parameterCount; i++) {
       if (name.Matches(runtimeMember.GetParameterName(i))) return true;
     }
     return false;
 }
 public bool MatchesParameterCount(RuntimeMember runtimeMember)
 {
     return runtimeMember.MatchesParameterCount(parameterCount);
 }
 public bool MatchesParameterNames(RuntimeMember runtimeMember)
 {
     return
         parameterIdNames == null ||
         parameterIdNames.All(name => HasMatchingParameter(runtimeMember, name));
 }
Exemple #7
0
 private bool Matches(RuntimeMember runtimeMember)
 {
     if (!runtimeMember.MatchesParameterCount(parameterCount)) return false;
     if (parameterTypes == null) return true;
     for (int i = 0; i < parameterCount; i++) {
         if (runtimeMember.GetParameterType(i) != parameterTypes[i]) return false;
     }
     return true;
 }