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
SearchConditionTypeThe SearchConditionType of the condition node. Must be either AndCondition or OrCondition.
simplify
boolTRUE 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
PropertyKeyThe property to be compared.
value
boolThe boolean value against which the property value should be compared.
operation
SearchConditionOperationSpecific 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
PropertyKeyThe property to be compared.
value
DateTimeThe DateTime value against which the property value should be compared.
operation
SearchConditionOperationSpecific 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
PropertyKeyThe property to be compared.
value
doubleThe Floating Point value against which the property value should be compared.
operation
SearchConditionOperationSpecific 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
PropertyKeyThe property to be compared.
value
intThe Integer value against which the property value should be compared.
operation
SearchConditionOperationSpecific 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
PropertyKeyThe property to be compared.
value
stringThe constant value against which the property value should be compared.
operation
SearchConditionOperationSpecific 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
stringThe 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
boolThe Boolean value against which the property value should be compared.
operation
SearchConditionOperationSpecific 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
stringThe 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
DateTimeThe DateTime value against which the property value should be compared.
operation
SearchConditionOperationSpecific 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
stringThe 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
doubleThe Floating Point value against which the property value should be compared.
operation
SearchConditionOperationSpecific 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
stringThe 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
intThe Integer value against which the property value should be compared.
operation
SearchConditionOperationSpecific 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
stringThe 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
stringThe constant value against which the property value should be compared.
operation
SearchConditionOperationSpecific 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
SearchConditionSearchCondition node to be negated.
simplify
boolTrue 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
stringThe query to be parsed
Returns
- SearchCondition
Search condition resulting from the query
Remarks
For more information on structured query syntax, visit http://msdn.microsoft.com/en-us/library/bb233500.aspx and http://www.microsoft.com/windows/products/winfamily/desktopsearch/technicalresources/advquery.mspx
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
stringThe query to be parsed
cultureInfo
CultureInfoThe culture used to select the localized language for keywords.
Returns
- SearchCondition
Search condition resulting from the query
Remarks
For more information on structured query syntax, visit http://msdn.microsoft.com/en-us/library/bb233500.aspx and http://www.microsoft.com/windows/products/winfamily/desktopsearch/technicalresources/advquery.mspx