Policy files are XML files that enable you to enforce the restrictions or policies of your company or development team and are written in the Enterprise Template Definition Language (TDL). The policy files contain information and restrictions on every project that can be included in a solution.
Just like any programming language API, TDL has many options with specific parameters. In the old days, this was the reason for carrying a large book that contained the definitions and available parameters for the API. However, with the introduction of Intellisense and code completion, those books have become unnecessary. If you edit a TDL file with Visual Studio .NET, you will immediately see that you made the correct decision as Visual Studio .NET understands the TDL file and you can take advantage of code completion.
Because it is always a good idea to learn the constructs and definitions of any language before you attempt to use it, each element and a brief description of its function are included in Table 41.2. Each element, known as a node, is written in uppercase and the structure and nesting of each node is enforced by the tdLSchema.xsd file. It is also worth noting that only nodes that are included in the TDLSchema.xsd file are allowed when creating policy files.
Table 41.2. TDL Elements as Indicated by MSDN Documentation
Defines a container for logically grouping similar elements defined in a different location of the policy file.
Defines a reusable grouping of logically similar elements.
Defines a reference to a predefined policy file element.
Defines the absolute position ID of a menu item in a menu hierarchy.
Defines a container for defining restrictions on IDE properties, menus, and toolbox items.
Defines the content information displayed by the Dynamic Help Window when navigating between IDE elements.
Defines a container for resolving contextual switching and initialization issues related to dynamic help within the Visual Studio .NET IDE.
Defines a default value for automatically initializing a property.
Defines the default inclusion or exclusion setting to apply to a group of policy file elements.
Defines global enterprise template policy file settings for each element.
Defines a unique ID for an IDE toolbox control.
Defines a unique enterprise template building block.
Defines a collection of all building blocks available to an enterprise template.
Defines a container for grouping building blocks.
Defines an enabled or disabled state for a menu item or toolbox item.
Defines which template building blocks are not permitted to be referenced from within the context of another building block.
Defines which set of menu or toolbox features may be associated to a specific template building block element.
Defines the collection of menu and toolbox items to be restricted via policy.
Defines a globally unique identifier for an IDE menu group.
Defines a mechanism for referencing a node from other places in the policy file.
Defines locating, identifying and configuration information about a specific policy file element.
Defines a name/value pair for processing references to elements.
Defines a collection of identifying nodes containing location, identification, and configuration information for specific elements.
Defines the ID of an element to include in another place in the policy file.
Defines the maximum allowable value a property or element may contain.
Defines restrictions on a specific element based upon an ID.
Defines a collection of restraints applying to specific menu, toolbox, or properties based upon an ID.
Defines a menu item for later reference in the policy file.
Defines the enabled or disabled restraint for a menu item.
Defines a collection of context-based restricted menu items.
Defines a relationship where a menu item is disabled if the associated item is defined elsewhere in the policy file with an exclusion setting.
Defines a collection of menu items to be disabled when the associated item has the exclusion property set.
Defines a collection of menus to be included in the policy file.
Defines a minimum allowable value for an element.
Defines a reference identifier for accessing the node containing the value.
Defines the order in which include/exclude settings are evaluated within a policy file element.
Defines the mechanism for handling undefined or unrecognized items.
Defines scope-restricted settings for properties displayed within the IDE properties browser window.
Defines a collection of scope-restricted settings for properties displayed within the IDE properties browser window.
Defines the location of a project, item, or enterprise template project from which a specific type of project can be created.
Defines a collection of location information for finding and creating specific types of enterprise template projects.
Defines if a property is allowed to be edited.
Defines the root node of a policy file, which contains all other policy file elements.
Defines if a specific toolbox item should be contextually enabled or disabled.
Defines a collection of toolbox items that should be contextually enabled or disabled.
Defines an item to display within the toolbox.
Defines a collection of items to display within the toolbox.
Defines a relationship where a toolbox item is disabled if the associated item is defined elsewhere in the policy file with an exclusion setting.
Defines a collection of toolbox items to be disabled when the associated item has the exclusion property set.
Defines a label identifying the type of the logical element.
Defines the data portion of a name/value pair.