Esempio n. 1
0
 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;
 }
Esempio n. 2
0
 bool Matches(RuntimeMember runtimeMember) {
     return
         specification.MatchesParameterCount(runtimeMember) &&
         specification.MatchesParameterTypes(runtimeMember) &&
         specification.MatchesParameterNames(runtimeMember);
 }
Esempio n. 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;
 }
Esempio n. 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;
 }
Esempio n. 5
0
 public bool MatchesParameterCount(RuntimeMember runtimeMember)
 {
     return runtimeMember.MatchesParameterCount(parameterCount);
 }
Esempio n. 6
0
 public bool MatchesParameterNames(RuntimeMember runtimeMember)
 {
     return
         parameterIdNames == null ||
         parameterIdNames.All(name => HasMatchingParameter(runtimeMember, name));
 }
Esempio n. 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;
 }