public static List <MethodDefinition> FilterMethods(this TypeDefinition type, FilterMode mode) { var filter = FilterFunctions.GetMethodFilter(mode); List <MethodDefinition> methods = new List <MethodDefinition>(); foreach (MethodDefinition methodDef in type.Methods) { if (filter(type, methodDef)) { methods.Add(methodDef); } } return(methods); }
public static List <EventDefinition> FilterEvents(this TypeDefinition type, FilterMode mode) { var filter = FilterFunctions.GetEventFilter(mode); List <EventDefinition> events = new List <EventDefinition>(); foreach (EventDefinition ev in type.Events) { if (filter(type, ev)) { events.Add(ev); } } return(events); }
public static List <FieldDefinition> FilterFields(this TypeDefinition type, FilterMode mode) { var filter = FilterFunctions.GetFieldFilter(mode); List <FieldDefinition> fields = new List <FieldDefinition>(); foreach (FieldDefinition fieldDef in type.Fields) { if (filter(type, fieldDef)) { fields.Add(fieldDef); } } return(fields); }