There are only a few changes needed. This modified MainForm.cs adds a table to the top of the toolbox:
https://mindfusion.org/_samples/MainForm.zipBelow are outlined the differences between it and the original sample.
First, the Listbox.Sort property is now set to false in order to allow displaying the table at the top. The table item is added like this:
_nodes = new Node[]
{
new Node("Table", "Entity"),
...
The OnDrawItem handler checks the NodeType property, and if it's a "Table" the drawing code looks like this:
t = _hidden.Factory.CreateTableNode(1, 1, 24, 24);
t.Brush = new SolidBrush(Color.White);
The DragDrop handler adds a case for NodeType == "Table" too:
TableNode t = diagram.Factory.CreateTableNode(pt, new SizeF(30, 40));
t.Brush = new SolidBrush(Color.White);
And the Node class has a new string NodeType property and a new overloaded constructor to initialize it:
public Node(AnchorPattern anchor,
Shape template, string name)
{
_anchor = anchor;
_template = template;
_name = name;
nodeType = "Shape";
}
public Node(string nodeType, string name)
{
_anchor = null;
_template = null;
_name = name;
this.nodeType = nodeType;
}
I hope that helps,
Stoyan