共用方式為


scope 元素 (搜尋連接器架構)

選擇性 < 範圍 > 元素會指定 scopeItem > 元素的 < 集合,這個集合會定義這個特定搜尋連接器的範圍包含和排除範圍。 如果 < scope > 存在,它必須至少包含一個 < scopeItem > 元素。 這個元素沒有屬性。

Syntax

<!-- scope -->
    <xs:complexType name="searchConnectorDescriptionType">
        <xs:all>
        ...
        <xs:element name="scope" minOccurs="0">
            <xs:complexType>
                <xs:sequence minOccurs="0">
                    <xs:element name="scopeItem" maxOccurs="unbounded">
                       ...
                    </xs:element>
                </xs:sequence>
            </xs:complexType>
        </xs:element>
        ...
        </xs:all>
        <xs:attribute name="publisher" type="xs:string"/>
        <xs:attribute name="product" type="xs:string"/>
    </xs:complexType>

項目資訊

Parent 項目 子元素
searchConnectorDescriptionType 元素 (搜尋連接器架構) scopeItem 元素 (搜尋連接器架構)

 

備註

<使用 scope > 和 < scopeItem > 元素來識別應該搜尋的位置,以及應該從搜尋中排除哪些位置。

範例

下列範例顯示包含 C:\ExampleFolder 及其所有子資料夾的搜尋範圍,但 C:\ExampleFolder\ExcludeMe 除外。

<?xml version="1.0" encoding="UTF-8"?>
<searchConnectorDescription xmlns="http://schemas.microsoft.com/windows/2009/searchConnector">
    ...
    <scope>
        <scopeItem>
            <mode>Include</mode>
            <depth>Deep</depth>
            <url>C:\ExampleFolder</url>
        </scopeItem>
        <scopeItem>
            <mode>Exclude</mode>
            <depth>Deep</depth>
            <url>C:\ExampleFolder\ExcludeMe</url>
        </scopeItem>
    </scope>
    ...
</searchConnectionDescription>