다음을 통해 공유


Default 요소(IntelliSense 코드 조각)

IntelliSense 코드 조각에 대한 리터럴 또는 개체의 기본값을 지정합니다.

<Default>
    Default value
</Default>

특성 및 요소

다음 단원에서는 특성, 자식 요소 및 부모 요소에 대해 설명합니다.

특성

없음

자식 요소

없음

부모 요소

요소

설명

Literal

편집할 수 있는 코드 조각의 리터럴 필드를 정의합니다.

Object

편집할 수 있는 코드 조각의 개체 필드를 정의합니다.

텍스트 값

텍스트 값이 필요합니다.

이 텍스트는 편집할 수 있는 코드 조각의 필드를 채우는 리터럴이나 개체의 기본값을 지정합니다.

예제

다음 코드에서는 기본값이 SQL인 리터럴과 기본값이 Connection인 개체를 보여 줍니다. 코드 조각이 프로젝트에 삽입되면 Default 요소의 텍스트 값은 리터럴 또는 개체를 나타냅니다.

<CodeSnippets xmlns="https://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
        <Header>
            <Title>Create a data adapter</Title>
            <Description>Creates a SqlDataAdapter object.</Description>
            <Author>Microsoft Corporation</Author>
            <Shortcut>createadapter</Shortcut>
        </Header>
        <Snippet>
            <Declarations>
                <Literal>
                    <ID>SQL</ID>
                    <ToolTip>Replace with a SQL connection string.</ToolTip>
                    <Default>"SQL connection string"</Default>
                </Literal>
                <Object>
                    <ID>Connection</ID>
                    <Type>System.Data.SqlClient.SqlConnection</Type>
                    <ToolTip>Replace with a connection object in your application.</ToolTip>
                    <Default>dcConnection</Default>
                </Object>
            </Declarations>
            <Code Language="CSharp">
                <![CDATA[
                    daCustomers = new SqlClient.SqlDataAdapter();
                    selectCommand = new SqlClient.SqlCommand($SQL$);
                    daCustomers.SelectCommand = selectCommand;
                    daCustomers.SelectCommand.Connection = $Connection$;
                ]]>
            </Code>
        </Snippet>
    </CodeSnippet>
</CodeSnippets>

참고 항목

개념

코드 조각 스키마 참조