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");
            }
        }
Ejemplo n.º 2
0
 public static O2CodeStream show(this O2CodeStream o2CodeStream, SourceCodeEditor codeEditor)
 {
     if (o2CodeStream != null)
     {
         codeEditor.open(o2CodeStream.SourceFile);
         codeEditor.colorINodes(o2CodeStream.iNodes());
     }
     return(o2CodeStream);
 }
 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); };


        }
		public void showCodeStream(O2CodeStream codeStream)
		{							
			codeStream.show(CodeViewer.editor());
			codeStream.show(CodeStreamTreeView);
			CodeStreamTreeView.expand();
		}