FilterNReflect

Filters can be used to describe which types and members to reflect.

Overview

The following figure shows all types related to the filter system of NReflect:

Filter
Figure 1: Class diagram showing the filters supplied with NReflect.

A filter implements the NReflect.Filter.IFilter interface.

Creating a new filter

If you want to create your own filter, just implement the interface NReflect.Filter.IFilter and provide an instance of your type to the Reflector.Reflect(String, IFilter, Boolean) method. While reflecting, the methods will be called for every type and member to reflect.

Supplied filters

The following three filters are supplied with NReflect:

Supplied filters
Filter nameDescription
NReflect.Filter.ReflectAllFilter The most easy filter supplied is this one: If used, it will reflect everything without any exception.
NReflect.Filter.IncludeFilter This filter takes a set of rules to determine which type and element to reflect. Each rule is an instance of the type NReflect.Filter.FilterRule.
NReflect.Filter.InvertFilter This filter inverts the results of another filter.
NReflect.Filter.StatisticFilter This filter doesn't filter anything. It just counts the occurrence of each entity and member. Like the InvertFilter, this filter needs another filter to work. After reflection is done, one can get the statistcs values by accessing the properties of the NReflect.Filter.StatisticFilter.

See Also

Reference

Other Resources