Implement a block node
This procedure assumes you have already implemented a context node, as described in Implement a context node.
To implement a block node:
- Define a class that inherits from the
BlockNode
base class - Add the
UseWithContext
attribute to connect it to your context node
The resulting code looks like:
[UseWithContext(typeof(MyContextNode))]
[Serializable]
public class MyBlockNode : BlockNode
{
}
To relate a block node to several context nodes, list them separated with a comma in your UseWithContext
attribute:
[UseWithContext(typeof(MyContextNode), typeof(MyOtherContextNode))]
[Serializable]
public class MyBlockNodeWithMultipleContexts : BlockNode
{
}
Block nodes inherit all features available in its parent Node
class. Review Implement a node to learn how to customize your node with node options, ports, and orientation settings.