Programmatically adding Transitions to StateChart

Heya. I’m running into some trouble programmatically adding Transition arrows to State Chart Document based on the StateCharter3 sample.

To add new nodes you just call StateChartDoc.NewNode() but there is no equivalent function for transitions. I need a function to add a Transition that connects two existing GoBasicNodes in the document with the following signature:

StateChartDocument.NewTransition(GoBasicNode from, GoBasicNode to)

public static Transition NewTransition(GoBasicNode from, GoBasicNode to) {

Transition link = new Transition();

link.FromPort = from.Port;

link.ToPort = to.Port;

return link;