public class ChartDoc : GoDocument
{
public GoTextNode RootNode = null;
:
public void Initialize()
{
GoTextNode start = new ChartNode(NodeKind.Start);
start.Text = "Start";
Add(start);
RootNode = start;<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
:
I add a TraverseButton and an OutputTextBox to the Form1 interface and then to traverse the Chart I just do something like this:
private void TraverseButton_Click(object sender, EventArgs e)
{
DisplayDestinationInfo(goView1.Doc.RootNode);
{
void DisplayDestinationInfo(IGoNode node)
{
foreach (IGoNode next in node.Destinations)
{
ChartNode chrtNode = next as ChartNode;
if (chrtNode != null)
{
Info nInfo = chrtNode.Info;
if (nInfo != null)
OutputTextBox.Text += "chrtNode.Info.Label: " + chrtNode.Info.Label + Environment.NewLine;
}
DisplayDestinationInfo(next);
}
}
public class TransformChartLink : GoXmlTransformer
{
base.ConsumeAttributes(obj);
ChartLink link = (ChartLink)obj;
ChartNode from = null;
String fromid = StringAttr("from", null);
if (fromid != null)
{
from = this.Reader.FindShared(fromid) as ChartNode;
:
}
String toid = StringAttr("to", null);
ChartNode to = null;
if (toid != null)
{
to = this.Reader.FindShared(toid) as ChartNode;
:
}
if (from != null && to != null)
{
IGoNode gn = from as IGoNode;
// ?? how add 'to' Node to from.Destinations
}