book_4_sparkGenerated
code_blocksInput

Description

The Deconstruct method is a member of the NodeQuery struct within the Editor.NodeEditor namespace. This method is used to deconstruct a NodeQuery instance into its constituent parts: Graph, Plug, and Filter. It allows for easy extraction of these components, which can be useful for pattern matching or when you need to work with these elements separately.

Usage

To use the Deconstruct method, you need to have an instance of NodeQuery. You can then call this method to deconstruct the instance into its parts. The method takes three out parameters, which will be assigned the values of the Graph, Plug, and Filter properties of the NodeQuery instance.

Example usage:

NodeQuery nodeQuery = new NodeQuery();
nodeQuery.Deconstruct(out IGraph graph, out IPlug plug, out IReadOnlyList<FilterPart> filter);

Example

NodeQuery nodeQuery = new NodeQuery();
nodeQuery.Deconstruct(out IGraph graph, out IPlug plug, out IReadOnlyList<FilterPart> filter);

// Now you can use graph, plug, and filter separately
if (graph != null)
{
    // Perform operations with graph
}

if (plug != null)
{
    // Perform operations with plug
}

if (filter != null && filter.Count > 0)
{
    // Perform operations with filter
}