Table of Contents

Class SearchConditionFactory

Namespace
Microsoft.WindowsAPICodePack.Shell
Assembly
Microsoft.WindowsAPICodePack.Shell.dll

Provides methods for creating or resolving a condition tree that was obtained by parsing a query string.

public static class SearchConditionFactory
Inheritance
SearchConditionFactory
Inherited Members

Methods

CreateAndOrCondition(SearchConditionType, bool, params SearchCondition[])

Creates a condition node that is a logical conjunction ("AND") or disjunction ("OR") of a collection of subconditions.

public static SearchCondition CreateAndOrCondition(SearchConditionType conditionType, bool simplify, params SearchCondition[] conditionNodes)

Parameters

conditionType SearchConditionType

The SearchConditionType of the condition node. Must be either AndCondition or OrCondition.

simplify bool

TRUE to logically simplify the result, if possible; then the result will not necessarily to be of the specified kind. FALSE if the result should have exactly the prescribed structure. An application that plans to execute a query based on the condition tree would typically benefit from setting this parameter to TRUE.

conditionNodes SearchCondition[]

Array of subconditions

Returns

SearchCondition

New SearchCondition based on the operation

CreateLeafCondition(PropertyKey, bool, SearchConditionOperation)

Creates a leaf condition node that represents a comparison of property value and Boolean value. Overload method takes a DateTime parameter for the comparison value.

public static SearchCondition CreateLeafCondition(PropertyKey propertyKey, bool value, SearchConditionOperation operation)

Parameters

propertyKey PropertyKey

The property to be compared.

value bool

The boolean value against which the property value should be compared.

operation SearchConditionOperation

Specific condition to be used when comparing the actual value and the expected value of the given property

Returns

SearchCondition

SearchCondition based on the given parameters

Remarks

The search will only work for files that are indexed, as well as the specific properties are indexed. To find the properties that are indexed, look for the specific property's property description and TypeFlags property for IsQueryable flag.

CreateLeafCondition(PropertyKey, DateTime, SearchConditionOperation)

Creates a leaf condition node that represents a comparison of property value and constant value. Overload method takes a DateTime parameter for the comparison value.

public static SearchCondition CreateLeafCondition(PropertyKey propertyKey, DateTime value, SearchConditionOperation operation)

Parameters

propertyKey PropertyKey

The property to be compared.

value DateTime

The DateTime value against which the property value should be compared.

operation SearchConditionOperation

Specific condition to be used when comparing the actual value and the expected value of the given property

Returns

SearchCondition

SearchCondition based on the given parameters

Remarks

The search will only work for files that are indexed, as well as the specific properties are indexed. To find the properties that are indexed, look for the specific property's property description and TypeFlags property for IsQueryable flag.

CreateLeafCondition(PropertyKey, double, SearchConditionOperation)

Creates a leaf condition node that represents a comparison of property value and Floating Point value. Overload method takes a DateTime parameter for the comparison value.

public static SearchCondition CreateLeafCondition(PropertyKey propertyKey, double value, SearchConditionOperation operation)

Parameters

propertyKey PropertyKey

The property to be compared.

value double

The Floating Point value against which the property value should be compared.

operation SearchConditionOperation

Specific condition to be used when comparing the actual value and the expected value of the given property

Returns

SearchCondition

SearchCondition based on the given parameters

Remarks

The search will only work for files that are indexed, as well as the specific properties are indexed. To find the properties that are indexed, look for the specific property's property description and TypeFlags property for IsQueryable flag.

CreateLeafCondition(PropertyKey, int, SearchConditionOperation)

Creates a leaf condition node that represents a comparison of property value and Integer value. Overload method takes a DateTime parameter for the comparison value.

public static SearchCondition CreateLeafCondition(PropertyKey propertyKey, int value, SearchConditionOperation operation)

Parameters

propertyKey PropertyKey

The property to be compared.

value int

The Integer value against which the property value should be compared.

operation SearchConditionOperation

Specific condition to be used when comparing the actual value and the expected value of the given property

Returns

SearchCondition

SearchCondition based on the given parameters

Remarks

The search will only work for files that are indexed, as well as the specific properties are indexed. To find the properties that are indexed, look for the specific property's property description and TypeFlags property for IsQueryable flag.

CreateLeafCondition(PropertyKey, string, SearchConditionOperation)

Creates a leaf condition node that represents a comparison of property value and constant value.

public static SearchCondition CreateLeafCondition(PropertyKey propertyKey, string value, SearchConditionOperation operation)

Parameters

propertyKey PropertyKey

The property to be compared.

value string

The constant value against which the property value should be compared.

operation SearchConditionOperation

Specific condition to be used when comparing the actual value and the expected value of the given property

Returns

SearchCondition

SearchCondition based on the given parameters

Remarks

The search will only work for files that are indexed, as well as the specific properties are indexed. To find the properties that are indexed, look for the specific property's property description and TypeFlags property for IsQueryable flag.

CreateLeafCondition(string, bool, SearchConditionOperation)

Creates a leaf condition node that represents a comparison of property value and Boolean value.

public static SearchCondition CreateLeafCondition(string propertyName, bool value, SearchConditionOperation operation)

Parameters

propertyName string

The name of a property to be compared, or null for an unspecified property. The locale name of the leaf node is LOCALE_NAME_USER_DEFAULT.

value bool

The Boolean value against which the property value should be compared.

operation SearchConditionOperation

Specific condition to be used when comparing the actual value and the expected value of the given property

Returns

SearchCondition

SearchCondition based on the given parameters

Remarks

The search will only work for files that are indexed, as well as the specific properties are indexed. To find the properties that are indexed, look for the specific property's property description and TypeFlags property for IsQueryable flag.

CreateLeafCondition(string, DateTime, SearchConditionOperation)

Creates a leaf condition node that represents a comparison of property value and constant value. Overload method takes a DateTime parameter for the comparison value.

public static SearchCondition CreateLeafCondition(string propertyName, DateTime value, SearchConditionOperation operation)

Parameters

propertyName string

The name of a property to be compared, or null for an unspecified property. The locale name of the leaf node is LOCALE_NAME_USER_DEFAULT.

value DateTime

The DateTime value against which the property value should be compared.

operation SearchConditionOperation

Specific condition to be used when comparing the actual value and the expected value of the given property

Returns

SearchCondition

SearchCondition based on the given parameters

Remarks

The search will only work for files that are indexed, as well as the specific properties are indexed. To find the properties that are indexed, look for the specific property's property description and TypeFlags property for IsQueryable flag.

CreateLeafCondition(string, double, SearchConditionOperation)

Creates a leaf condition node that represents a comparison of property value and Floating Point value.

public static SearchCondition CreateLeafCondition(string propertyName, double value, SearchConditionOperation operation)

Parameters

propertyName string

The name of a property to be compared, or null for an unspecified property. The locale name of the leaf node is LOCALE_NAME_USER_DEFAULT.

value double

The Floating Point value against which the property value should be compared.

operation SearchConditionOperation

Specific condition to be used when comparing the actual value and the expected value of the given property

Returns

SearchCondition

SearchCondition based on the given parameters

Remarks

The search will only work for files that are indexed, as well as the specific properties are indexed. To find the properties that are indexed, look for the specific property's property description and TypeFlags property for IsQueryable flag.

CreateLeafCondition(string, int, SearchConditionOperation)

Creates a leaf condition node that represents a comparison of property value and Integer value.

public static SearchCondition CreateLeafCondition(string propertyName, int value, SearchConditionOperation operation)

Parameters

propertyName string

The name of a property to be compared, or null for an unspecified property. The locale name of the leaf node is LOCALE_NAME_USER_DEFAULT.

value int

The Integer value against which the property value should be compared.

operation SearchConditionOperation

Specific condition to be used when comparing the actual value and the expected value of the given property

Returns

SearchCondition

SearchCondition based on the given parameters

Remarks

The search will only work for files that are indexed, as well as the specific properties are indexed. To find the properties that are indexed, look for the specific property's property description and TypeFlags property for IsQueryable flag.

CreateLeafCondition(string, string, SearchConditionOperation)

Creates a leaf condition node that represents a comparison of property value and constant value.

public static SearchCondition CreateLeafCondition(string propertyName, string value, SearchConditionOperation operation)

Parameters

propertyName string

The name of a property to be compared, or null for an unspecified property. The locale name of the leaf node is LOCALE_NAME_USER_DEFAULT.

value string

The constant value against which the property value should be compared.

operation SearchConditionOperation

Specific condition to be used when comparing the actual value and the expected value of the given property

Returns

SearchCondition

SearchCondition based on the given parameters

Remarks

The search will only work for files that are indexed, as well as the specific properties are indexed. To find the properties that are indexed, look for the specific property's property description and TypeFlags property for IsQueryable flag.

CreateNotCondition(SearchCondition, bool)

Creates a condition node that is a logical negation (NOT) of another condition (a subnode of this node).

public static SearchCondition CreateNotCondition(SearchCondition conditionToBeNegated, bool simplify)

Parameters

conditionToBeNegated SearchCondition

SearchCondition node to be negated.

simplify bool

True to logically simplify the result if possible; False otherwise. In a query builder scenario, simplyfy should typically be set to false.

Returns

SearchCondition

New SearchCondition

ParseStructuredQuery(string)

Parses an input string that contains Structured Query keywords (using Advanced Query Syntax or Natural Query Syntax) and produces a SearchCondition object.

public static SearchCondition ParseStructuredQuery(string query)

Parameters

query string

The query to be parsed

Returns

SearchCondition

Search condition resulting from the query

Remarks

ParseStructuredQuery(string, CultureInfo)

Parses an input string that contains Structured Query keywords (using Advanced Query Syntax or Natural Query Syntax) and produces a SearchCondition object.

public static SearchCondition ParseStructuredQuery(string query, CultureInfo cultureInfo)

Parameters

query string

The query to be parsed

cultureInfo CultureInfo

The culture used to select the localized language for keywords.

Returns

SearchCondition

Search condition resulting from the query

Remarks