Share via


Excluding Types

This option excludes a type by name or by attribute specifier. You can use an RE to specify the type name.

Type names should be fully qualified names.

Inner (nested) classes are specified by using the ‘/’ as a delimiter between outer and inner class. For example:

<type name="Library.Class1/NestedClass"/>

Attribute specifiers are selected or deselected with the “speclist” attribute. The "speclist" attribute is a comma-separated list of legal attribute specifiers for types. The legal values are:

abstract
interface
nestedassembly
nestedfamily
nestedfamorassem
nestedprivate
nestedpublic
notpublic
public
sealed
serializable
enum

A ‘-‘ preceding an attribute specifier negates the rule (i.e. it excludes all classes that do not have the specified attribute). A ‘+’ may be specified but is not required. The rules implied in this list are logically ANDed together (that is, the set of excluded types is the intersection of all types that match each rule.). For instance, the following rule excludes any type that is public AND sealed.

<type name=”.*” speclist=”+public,+sealed” regex=”true”/>

The <type> element may also be used just to select a type in order to specify rules for field and method exclusion within it. This allows type names to be renamed while preserving member names. The optional “excludetype” attribute is used for this purpose. If not specified, the default value is “true”, meaning that the type name will be excluded.

<type name="MyCo.Test.MyOtherTest" excludetype="false">
 <!-- methods and fields excluded here -->
 ...
</type>

If a <type> element contains no nested field or method elements, then no methods and fields are selected for exclusion. This allows type names to be preserved while allowing members to be renamed.

Property and event names in excluded types are also preserved. (Remember that if a type is not excluded and the library option is not set, Dotfuscator removes property and event names.)

© 2002-2007 PreEmptive Solutions. All rights reserved.