- static bool IsVirtualFilter (MemberInfo m, object filterCriteria)
- {
- MethodInfo mi = m as MethodInfo;
- return (mi == null) ? false : mi.IsVirtual;
- }
-
- /// <summary>
- /// Inits the virtual_method_filter
- /// </summary>
- static PendingImplementation ()
- {
- virtual_method_filter = new MemberFilter (IsVirtualFilter);
- }
-
- // <remarks>
- // Returns a list of the abstract methods that are exposed by all of our
- // bases that we must implement. Notice that this `flattens' the
- // method search space, and takes into account overrides.
- // </remarks>
- static ArrayList GetAbstractMethods (Type t)
- {
- ArrayList list = null;
- bool searching = true;
- Type current_type = t;
-
- do {
- MemberList mi;
-
- mi = TypeContainer.FindMembers (
- current_type, MemberTypes.Method,
- BindingFlags.Public | BindingFlags.NonPublic |
- BindingFlags.Instance | BindingFlags.DeclaredOnly,
- virtual_method_filter, null);
-
- if (current_type == TypeManager.object_type)
- searching = false;
- else {
- current_type = current_type.BaseType;
- if (!current_type.IsAbstract)
- searching = false;
- }
-
- if (mi.Count == 0)
- continue;
-
- if (mi.Count == 1 && !(mi [0] is MethodBase))
- searching = false;
- else
- list = TypeManager.CopyNewMethods (list, mi);
- } while (searching);
-
- if (list == null)
- return null;
-
- for (int i = 0; i < list.Count; i++){
- while (list.Count > i && !((MethodInfo) list [i]).IsAbstract)
- list.RemoveAt (i);
- }
-
- if (list.Count == 0)
- return null;
-
- return list;
- }
-
- PendingImplementation (TypeContainer container, MissingInterfacesInfo [] missing_ifaces, ArrayList abstract_methods, int total)