Class Filter
- Namespace
- DuetControlServer.Model
- Assembly
- DuetControlServer.dll
Provides filter functionality to get partial object model data
public class Filter
- Inheritance
-
Filter
- Inherited Members
Constructors
Filter(ObjectModel)
Provides filter functionality to get partial object model data
public Filter(ObjectModel model)
Parameters
modelObjectModel
Methods
ConvertFilter(string, bool)
Convert a filter string into an object array that can be used to traverse the object model
public static object[] ConvertFilter(string filter, bool codeExpression)
Parameters
Returns
- object[]
Object array
ConvertFilter(string[])
Convert filter string items into an object array that can be used to traverse the object model
public static object[] ConvertFilter(string[] filter)
Parameters
filterstring[]Filter expression
Returns
- object[]
Object array
ConvertFilters(IEnumerable<string>)
Convert multiple filter strings into an object array that can be used to traverse the object model
public static object[][] ConvertFilters(IEnumerable<string> filters)
Parameters
filtersIEnumerable<string>Delimited filter expressions
Returns
- object[][]
Object array
ConvertFilters(string)
Convert delimited filter strings into an object array that can be used to traverse the object model
public static object[][] ConvertFilters(string filters)
Parameters
filtersstringDelimited filter expressions
Returns
- object[][]
Object array
GetFiltered(object[])
Get a partial object model with only fields that match the given filter
public Dictionary<string, object?> GetFiltered(object[] filter)
Parameters
filterobject[]Array consisting of case-insensitive property names or item indices
Returns
- Dictionary<string, object>
Dictionary holding the results or null if nothing could be found
Remarks
Make sure the model provider is locked in read-only mode before using this class
- See Also
GetFiltered(string)
Get a partial object model with only fields that match the given filter
public Dictionary<string, object?> GetFiltered(string filter)
Parameters
filterstringFilter string
Returns
- Dictionary<string, object>
Dictionary holding the results or null if nothing could be found
Remarks
Make sure the model provider is locked in read-only mode before using this class
- See Also
GetFiltered(string, QueryFlags)
Get a partial object model with only fields that match the given filter and query flags
public Dictionary<string, object?> GetFiltered(string filter, QueryFlags queryFlags)
Parameters
filterstringFilter string
queryFlagsQueryFlagsFlags controlling which properties are included
Returns
- Dictionary<string, object>
Dictionary holding the results or null if nothing could be found
Remarks
Make sure the model provider is locked in read-only mode before using this class
GetSpecific(string, bool, out object?)
Find a specific object in the object model (wildcards are not supported)
public bool GetSpecific(string filter, bool findSbcProperty, out object? result)
Parameters
filterstringFilter for finding a property or a list item
findSbcPropertyboolWhether the object may be an SBC property
resultobjectPartial object model or null
Returns
- bool
Whether the object could be found
MergeFiltered(Dictionary<string, object?>, Dictionary<string, object?>)
Merge two filtered object models
public static void MergeFiltered(Dictionary<string, object?> a, Dictionary<string, object?> b)
Parameters
aDictionary<string, object>First partial object model
bDictionary<string, object>Second partial object model
PathMatches(object[], object[])
Checks if a change path matches a given filter
public static bool PathMatches(object[] path, object[] filter)
Parameters
Returns
- bool
True if a filter applies