Share via


The Method Signature Matching Rule

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.

The Method Signature Matching Rule allows developers, operators, and administrators to select target classes based on the name and signature (the list of parameter types) of its members. This rule allows the use of wildcard characters for the member names.

Note

The Policy Injection Application Block includes matching rule configuration placeholders that provide backward compatibility. The implementation of matching rules is described in the Unity Application Block documentation. For more information, see The Method Signature Matching Rule in the Unity Application Block documentation.

Configuration Settings of the Method Signature Matching Rule

The following configuration settings are available for the Method Signature Matching Rule:

  • Match (String). This is the name of the target member method. It can consist of or include the * or ? wildcard characters to select multiple methods. You can also use square brackets [ ] to specify a range of characters.
  • IgnoreCase (Boolean). This specifies whether the method name match should be carried out on a case-sensitive basis.
  • A collection of parameter matches, each consisting of a single property:
    • TypeName (String). This is the type name of the target member parameter.

The next procedure describes how to configure the Method Signature Matching Rule using the Configuration Console or the Visual Studio Configuration Editor.

To configure the Method Signature Matching Rule

  1. Right-click the Matching Rules node in the Enterprise Library Configuration Console or Visual Studio Configuration Editor, point to New, and then click Method Signature Matching Rule.
  2. In the right pane of the Enterprise Library Configuration Console, or in the Visual Studio Properties window, select the Name property, and then change the default name to the name you want to use for the new matching rule.
  3. Select the Match property and enter the name of the target method (which can include square brackets, or the * or ? wildcard characters) that you want this rule to select.
  4. Select the IgnoreCase property, and then click either True or False to specify whether the match on the target method name should be case-sensitive.
  5. Select the ParameterTypes property, and then click the ellipsis button (...) to open the ParameterType Collection Editor dialog box.
  6. Click Add and, in the right pane of the dialog box, enter the full type name, such as System.String, of the first parameter of the target method.
  7. Repeat the previous step to add all the required parameter types in the order they occur in the target method signature, and then click OK to close the ParameterType Collection Editor dialog box.