Share via


The Tag Attribute 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 Tag Attribute Matching Rule allows developers, operators, and administrators to select target classes based on the name of an attribute of type Tag that is applied to a class, or to members (methods or properties) within a class, including using wildcard characters for the attribute name.

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

Configuration Settings of the Tag Attribute Matching Rule

The configuration settings available for the Tag Attribute Matching Rule consist of two properties:

  • Match (String). This is the name of the Tag attribute that is attached to the target object, such as "MyTagName". It cannot include wildcard characters.
  • IgnoreCase (Boolean). It specifies whether the match should be carried out on a case-sensitive basis.

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

To configure the Tag Attribute 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 Tag Attribute Matching Rule.
  2. In the right node 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 value that the Tag attribute will have to select a class or class member. For example, if the attribute you use is [Tag("SelectMe")], the value to enter is SelectMe.
  4. Select the IgnoreCase property, and then click either True or False in the drop-down list to specify whether the match on the Tag attribute value should be case-sensitive.