Implement context nodes for your graph tool
Create context nodes to organize and contain block nodes in the graph tool.
Read time 1 minuteLast updated a month ago
Create context nodes to organize and contain block nodes in the graph tool.
Context nodes provide context-specific information or functionality and contain only block nodes. A context node inherits all features available in its parent class.
NodeThis page covers how to implement context nodes only. For information on how to implement block nodes, refer to Implement block nodes for your graph tool. For information about node types, refer to About nodes.
Prerequisites
Before you can implement context nodes, you need to create a graph class. If you haven't done this yet, follow the instructions in Implement a graph tool.
Implement a context node
To implement a context node, define a class that inherits from the base class:
ContextNode[Serializable] public class MyContextNode : ContextNode { } #endregion MyContextNode #region MyBlockNode [UseWithContext(typeof(MyContextNode))] [Serializable] public class MyBlockNode : BlockNode { } #endregion MyBlockNode [Serializable] public class MyOtherContextNode : ContextNode { } #region MyBlockNodeWithMultipleContexts [UseWithContext(typeof(MyContextNode), typeof(MyOtherContextNode))] [Serializable] public class MyBlockNodeWithMultipleContexts : BlockNode { } #endregion MyBlockNodeWithMultipleContexts }}
Review Implement a node to learn how to customize the node with node options, ports, and orientation settings.