public static void show_CodeStreamNode(this GraphLayout graphLayout, O2CodeStream codeStream, O2CodeStreamNode codeStreamNode, CodeStreamGraphNode previousNode) { try { if (codeStreamNode == null) return; if (previousNode == null) previousNode = graphLayout.add_CodeStreamNode(codeStream, codeStreamNode); else previousNode = graphLayout.add_CodeStreamEdge(codeStream, codeStreamNode, previousNode); foreach (var childNode in codeStreamNode.ChildNodes) { if (codeStreamNode != childNode) graphLayout.show_CodeStreamNode(codeStream, childNode, previousNode); else "in show_StreamNode, streamNode == childNode: {0}".error(childNode.Text); } } catch (Exception ex) { ex.log("in show_StreamNode"); } }
public static CodeStreamGraphNode add_CodeStreamEdge(this GraphLayout graphLayout, O2CodeStream codeStream, O2CodeStreamNode codeStreamNode, CodeStreamGraphNode previousGraphNode) { return (CodeStreamGraphNode)graphLayout.wpfInvoke( () => { var codeStreamGraphNode = new CodeStreamGraphNode(codeStream, codeStreamNode); graphLayout.add_Edge(previousGraphNode, codeStreamGraphNode); return codeStreamGraphNode; }); }
public CodeStreamGraphNode(O2CodeStream codeStream , O2CodeStreamNode codeStreamNode) { CodeStream = codeStream; CodeStreamNode = codeStreamNode; NodeText = CodeStreamNode.Text; this.Content = NodeText; setColorBasedOnObjectType(); this.MouseDoubleClick+=(sender,e) => { if (onDoubleClick != null) onDoubleClick(this);}; this.MouseEnter += (sender, e) => { if (onMouseEnter != null) onMouseEnter(this); }; this.MouseLeave += (sender, e) => { if (onMouseLeave != null) onMouseLeave(this); }; }