<?xml version="1.0"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>Display results in the Console window</Title>
      <Author>Microsoft Corporation</Author>
      <Description>Displays the results of a query in the Console window.</Description>
      <Shortcut>qConsole</Shortcut>
    </Header>
    <Snippet>
       <Declarations>
        <Literal>
          <ID>queryResult</ID>
          <Type>item</Type>
          <ToolTip>Replace with the identifier for the query.</ToolTip>
          <Default>query</Default>
        </Literal>
        <Literal>
          <ID>item</ID>
          <Type>item</Type>
          <ToolTip>Replace with the identifier for the variable that represents an item from your data source.</ToolTip>
          <Default>process</Default>
        </Literal>
        <Literal>
          <ID>dataSource</ID>
          <Type>String</Type>
          <ToolTip>Replace with the identifier for your data source.</ToolTip>
          <Default>System.Diagnostics.Process.GetProcesses()</Default>
        </Literal>
                 <Literal>
          <ID>field1</ID>
          <Type>String</Type>
          <ToolTip>Replace with the identifer for the first field you want to retrieve from your data source.</ToolTip>
          <Default>ProcessName</Default>
        </Literal>
        <Literal>
          <ID>field2</ID>
          <Type>String</Type>
          <ToolTip>Replace with the identifer for the second field you want to retrieve from your data source.</ToolTip>
          <Default>MainWindowTitle</Default>
        </Literal>
        <Literal>
          <ID>alias</ID>
          <Type>String</Type>
          <ToolTip>Replace with the alias you want to give to this data.</ToolTip>
          <Default>WindowTitle</Default>
        </Literal>
        <Literal>
          <ID>iterationVar</ID>
          <Type>String</Type>
          <ToolTip>Replace with the identifier for the iteration variable that represents an item from your query.</ToolTip>
          <Default>process</Default>
        </Literal>
      </Declarations>
      <Code Language="VB" Kind="method body"><![CDATA[Dim $queryResult$ = From $item$ In $dataSource$ _
                    Select $item$.$field1$, $alias$ = $item$.$field2$ _
                    Order By $field1$

                 For Each $iterationVar$ In $queryResult$
                     Console.WriteLine($iterationVar$.$field1$ & " " & $iterationVar$.$alias$)
                 Next]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>