- if (container.MemberCache.member_hash.TryGetValue (filter.Name, out applicable)) {
- for (int i = 0; i < applicable.Count; ++i) {
- var entry = applicable [i];
-
- // Is the member of the correct type
- if ((entry.Kind & filter.Kind & MemberKind.MaskType) == 0)
- continue;
-
- //
- // When using overloadable overrides filter ignore members which
- // are not base members. Including properties because overrides can
- // implement get or set only and we are looking for complete base member
- //
- const MemberKind overloadable = MemberKind.Indexer | MemberKind.Method | MemberKind.Property;
- if ((restrictions & BindingRestriction.NoOverrides) != 0 && (entry.Kind & overloadable) != 0) {
- if ((entry.Modifiers & Modifiers.OVERRIDE) != 0)
- continue;
-
- if ((entry.Modifiers & Modifiers.OVERRIDE_UNCHECKED) != 0) {
- bool is_override = true;
- var ms = entry as MethodSpec;
- if (ms != null) {
- is_override = IsRealMethodOverride (ms);
- } else {
- var ps = (PropertySpec) entry;
- if (ps.HasGet)
- is_override = IsRealMethodOverride (ps.Get);
- if (is_override && ps.HasSet)
- is_override = IsRealMethodOverride (ps.Set);
- }
-
- if (is_override) {
- entry.Modifiers = (entry.Modifiers & ~Modifiers.OVERRIDE_UNCHECKED) | Modifiers.OVERRIDE;
- continue;
- }
- }
- }
-
- if ((restrictions & BindingRestriction.InstanceOnly) != 0 && entry.IsStatic)
- continue;
-
- // Apply the filter to it.
- if (!filter.Equals (entry))
- continue;
-
- if (found == null) {
- if (i == 0) {
- found = applicable;
- } else {
- found = new List<MemberSpec> ();
- found.Add (entry);
- }
- } else if (found == applicable) {
- found = new List<MemberSpec> ();
- found.Add (applicable[0]);
- found.Add (entry);
- } else {
- found.Add (entry);
- }
- }
-
- if (found != null) {
- if (found == applicable && applicable.Count != 1)
- return new MemberSpec[] { found[0] };
-
- return found;
- }
- }