<?xml version="1.0"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>对查询结果计数</Title>
      <Author>Microsoft Corporation</Author>
      <Description>对查询的结果数进行计数。</Description>
      <Shortcut>qCount</Shortcut>
    </Header>
    <Snippet>
      <References>
        <Reference>
          <Assembly>System.Core.dll</Assembly>
        </Reference>
      </References>
      <Imports>
        <Import>
          <Namespace>System.Linq</Namespace>
        </Import>
      </Imports>
      <Declarations>
        <Literal>
          <ID>queryResult</ID>
          <Type>item</Type>
          <ToolTip>替换为查询的标识符。</ToolTip>
          <Default>query</Default>
        </Literal>
        <Literal>
          <ID>item</ID>
          <Type>item</Type>
          <ToolTip>替换为表示数据源项的范围变量的标识符。</ToolTip>
          <Default>word</Default>
        </Literal>
        <Literal>
          <ID>dataSource</ID>
          <Type>String</Type>
          <ToolTip>替换为数据源的标识符。</ToolTip>
          <Default>New String() {"apple", "orange", "pear", "banana"}</Default>
        </Literal>
        <Literal>
          <ID>field1</ID>
          <Type>String</Type>
          <ToolTip>替换为您要从源检索的第一个字段的标识符。</ToolTip>
          <Default>ToUpper()</Default>
        </Literal>
        <Literal>
          <ID>field2</ID>
          <Type>String</Type>
          <ToolTip>替换为您要从源检索的第二个字段的标识符。</ToolTip>
          <Default>Length</Default>
        </Literal>
      </Declarations>
      <Code Language="VB" Kind="method body"><![CDATA[Dim $queryResult$ = From $item$ In $dataSource$ _
                    Select $item$.$field1$, $item$.$field2$
                    
                 Dim count = $queryResult$.Count]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>
