Hi there.
I am currently trying to convert a GoBasicNode Application to match the GoMultiTextNode pattern. Unfortunatly it doesn´t work the way I planned it .
The nodes are displayed as little grey boxes so I assume that also I added objects with CreateText, these objects aren´t there.
The links are also no longer displayed. Is there a standard way to convert from the BasicNode Port Method to Multitext Ports? I basically only need a port on each side and GoDiagram should use the best port option for displaying the link.
I would like to use the demo (RecordNode) multitext node class in conjunction with the datasetmapper.cs from the dataset demo.
In the datamapper I changed the Initialize Node method:
public virtual void InitializeNode(GoNode node, DataRow row) {
node.UserObject = row;
JobNodeAdvanced n = new JobNodeAdvanced();
if (node != null) {
Color statusColor = new Color();
statusColor = Color.AntiqueWhite;
switch (row["Status"].ToString())
{
case "S": statusColor = Color.Turquoise; break;
case "E": statusColor = Color.Red; break;
case "W": statusColor = Color.Gray; break;
}
n.CreateHeaderText(row["Title"].ToString(), statusColor);
n.CreateText( row["line1"].ToString(), 1 );
n.CreateText( row["line2"].ToString(), 2 );
n.CreateText( row["line3"].ToString(), 3 );
n.CreateText( row["line4"].ToString(), 4 );
}
}
as well as the InitializeLink method:
public virtual void InitializeLink(GoLink link, GoNode fromNode, GoNode toNode, DataRow row) {
link.UserObject = row;
if (fromNode is GoMultiTextNode)
{
GoMultiTextNode n = (GoMultiTextNode)fromNode;
link.FromPort = (IGoPort) n.CreatePort(true,0);
}
if (toNode is GoMultiTextNode)
{
GoMultiTextNode n = (GoMultiTextNode)toNode;
link.ToPort = (IGoPort) n.CreatePort(false, 0);
}
}
Is there an example from which I can learn on how to integrate the GoMultiTextNode? Right know it´s a little bit of a black box process for me.
Thanks.
Elmar