Export (0) Print
Expand All
Expand Minimize

ElementDefs Element (Visual Studio Project Policy) 

Visual Studio 2005

Contains a list of IDE (integrated development environment) elements and the identifiers for those elements.


<ElementDefs><CodeType>...</CodeType><CodeVariable>...</CodeVariable><Reference>...</Reference><WebReference>...</WebReference><HtmlElement>...</HtmlElement><Project>...</Project><ProjectItem>...</ProjectItem><SolutionFolder>...</SolutionFolder><Feature>...</Feature></ElementDefs>

ElementDefsType

The following sections describe attributes, child elements, and parent elements.

Attributes

None

Child Elements

Element Description

CodeType

Optional DefsCodeType element.

Contains the identifiers, feature links, and prototypes for a code object, for example, a class, namespace, interface, or structure.

CodeVariable

Optional DefsCodeVariableType element.

Contains the identifiers and feature links for a specific control or a control that derives from a common base class.

Feature

Optional DefsFeatureType element.

Contains collections of command links and/or Toolbox item links that can be used in an element set or category.

HtmlElement

Optional DefsHtmlElementType element.

Contains the identifiers and feature links for an HTML Toolbox item.

Project

Optional DefsProjectType element.

Contains the identifiers, feature links, and prototypes for a Visual Studio project.

ProjectItem

Optional DefsProjectItemType element.

Contains the identifiers, feature links, and prototypes for a Visual Studio project item, for example, a text file or an HTML page.

Reference

Optional DefsReferenceType element.

Contains the identifiers for a project reference.

SolutionFolder

Optional DefsSolutionFolderType element.

Contains the identifiers for a Solution Folder.

WebReference

Optional DefsWebReferenceType element.

Contains the identifiers for a Web reference.

Parent Elements

Element Description

PolicyDefinitions

The root XML element of a policy definitions file.

Identifiers for all IDE elements must be defined in the policy definitions file. If you reference in an element set in the policy actions file an IDE element that is not defined in the policy definitions file, the policy actions file cannot load.

The child elements must be in the following order:

  • CodeType

  • CodeVariable

  • Reference

  • WebReference

  • HtmlElement

  • Project

  • ProjectItem

  • SolutionFolder

  • Feature

This example shows the element identification for a Windows form. The name of the class from which the code object derives is used as an identifier (System.Windows.Forms.Form), the command Add Windows Form is made unavailable in the Visual Studio IDE when Windows Forms are excluded from an element set in the policy actions file, and the prototype files that are used as a model for a Windows form in Visual C#, Visual Basic, Visual J#, and Visual C++ projects are specified.

<ElementDefs>
   <CodeType Id="codeWinForm">
      <Identifiers>
         <Inherits>System.Windows.Forms.Form</Inherits>
      </Identifiers>
      <FeatureLinks>
         <CommandLinks>
            <CommandLink>menuProject.AddWindowsForm</CommandLink>
         </CommandLinks>
      </FeatureLinks>
      <Prototypes>
         <Prototype>[VC#]\CSharpProjectItems\CSharpAddWinFormWiz.vsz      </Prototype>
         <Prototype>[VB]\VBProjectItems\WinForm.vsz</Prototype>
         <Prototype>[VJ#]\VJSharpProjectItems\VJSharpAddWinFormWiz.vsz</Prototype>
         <Prototype>[VC]\VCProjectItems\AddMC++WinForm.vsz</Prototype>
      </Prototypes>
   </CodeType>
</ElementDefs>

Namespace

http://schemas.microsoft.com/VSPolicy/PDLSchema

Schema Name

Visual Studio Project Policy

Validation File

Policy.xsd

Can be Empty

Yes

Community Additions

ADD
Show:
© 2014 Microsoft