Share via


The Parameter Type 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 Parameter Type Matching Rule allows developers, operators, and administrators to select target classes based on the type name of a parameter for a member of the target object.

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 Parameter Type Matching Rule in the Unity Application Block documentation.

Configuration Settings of the Parameter Type Matching Rule

The configuration settings available for the Parameter Type Matching Rule are a collection of parameter type matches, each consisting of three properties:

  • Match (String). This is the full namespace-qualified type name or just the type name of a parameter of a member of the target object. The following are examples:
    • System.Int32
    • String
    • Int32
  • Kind: (ParameterKind). This value specifies the usage of the parameter; it can be Input, Output, InputOrOutput, or ReturnValue.
  • IgnoreCase (Boolean). This specifies whether the match should be carried out on a case-sensitive basis.

The next procedure shows how to configure the Parameter Type Matching Rule using the Configuration Console or the Visual Studio Configuration Editor.

To configure the Parameter Type 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 Parameter Type 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 Matches property, and then click the ellipsis button (...) to open the Match Collection Editor dialog box.
  4. Click Add and, in the right pane of the dialog box, enter either the fully qualified parameter type name, or just the type name without its namespace, in the Value property.
  5. Select a value from the drop-down list for the Kind property. This can be Input, Output, InputOrOutput, or ReturnValue.
  6. Select either True or False in the drop-down list for the IgnoreCase property.
  7. Repeat steps 4, 5, and 6 to add all the parameter type matches you require, and then click OK to close the Match Collection Editor dialog box.