Type Element (IntelliSense Code Snippets)
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Type Element (IntelliSense Code Snippets) 

Specifies the type of the object.


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



Child Elements


Parent Elements

Element Description


Defines the object fields of the code snippet that you can edit.

A text value is required.

This text specifies the type of the object.

The Object element is used to identify an item that is required by the code snippet but is likely to be defined outside of the snippet itself. For example, Windows Forms controls, ASP.NET controls, object instances, and type instances should be declared as objects. Object declarations require that a type be specified, which is done with the Type element.

The following example uses the Type element to declare the type of an object in a code snippet.

<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
            <!-- Insert Header information here. -->
                    <ToolTip>Replace with a SQL connection string.</ToolTip>
                    <Default>"SQL connection string"</Default>
                    <ToolTip>Replace with a connection object in your application.</ToolTip>
            <Code Language="CSharp">
                <!-- Insert code here. -->
© 2015 Microsoft