Table of Contents

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

model ObjectModel

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

filter string

Filter expression

codeExpression bool

Whether the filter is from a G-code expression

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

filter string[]

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

filters IEnumerable<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

filters string

Delimited 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

filter object[]

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

filter string

Filter 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

filter string

Filter string

queryFlags QueryFlags

Flags 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

filter string

Filter for finding a property or a list item

findSbcProperty bool

Whether the object may be an SBC property

result object

Partial 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

a Dictionary<string, object>

First partial object model

b Dictionary<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

path object[]

Patch path

filter object[]

Path filter

Returns

bool

True if a filter applies