예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }