Exemplo n.º 1
0
        public static TreeNode addCirFunctionToTreeNodeCollection(ICirFunctionCall functionCall, string treeNodeNamePrefix, TreeNodeCollection treeNodeCollection, bool addDummyChildNode)
        {
            if (functionCall == null || functionCall.cirFunction == null)
            {
                return(null);
            }
            var cirFunction = functionCall.cirFunction;

            var treeNodeName = String.Format(" {0}{1} :                {2}", treeNodeNamePrefix, cirFunction.FunctionName, cirFunction.ClassNameFunctionNameAndParameters);
            var newTreeNode  = O2Forms.newTreeNode(treeNodeCollection, treeNodeName, cirFunction.FunctionSignature, 0, functionCall);

            if (addDummyChildNode)
            {
                newTreeNode.Nodes.Add(""); // Dummy node so that we have the plus sign
            }
            if (functionCall.fileName != null && functionCall.lineNumber > 0)
            {
                newTreeNode.ForeColor = System.Drawing.Color.DarkGreen;
            }
            else
            {
                newTreeNode.ForeColor = System.Drawing.Color.Red;
            }
            return(newTreeNode);
        }
Exemplo n.º 2
0
 public static void raiseSourceCodeReferenceEvent(bool raiseEvent, ICirFunctionCall functionCall, bool remapLineNumber)
 {
     if (raiseEvent)
     {
         if (functionCall.cirFunction != null && functionCall.fileName != null && functionCall.lineNumber > -1)
         {
             int mappedLineNumber = GetMappedLineNumber(functionCall.cirFunction.FunctionName, functionCall.fileName, functionCall.lineNumber, false, remapLineNumber);
             O2Messages.fileOrFolderSelected(functionCall.fileName, mappedLineNumber);
         }
     }
 }
Exemplo n.º 3
0
        public static void addToNode_IsCalledBy(ICirFunctionCall functionCall, TreeNode targetTreeNode, bool alwaysAddDummyChildNode, bool dontAddRecursiveCalls)
        {
            // NOTE: dontAddRecursiveCalls not implemented (yet)
            var cirFunction = functionCall.cirFunction;

            foreach (var isCalledBy in cirFunction.FunctionIsCalledBy)
            {
                addCirFunctionToTreeNodeCollection(isCalledBy, "<= ", targetTreeNode.Nodes,
                                                   alwaysAddDummyChildNode || isCalledBy.cirFunction.FunctionIsCalledBy.Count > 0);
            }
        }
 public static TreeNode addCirFunctionToTreeNodeCollection(ICirFunctionCall functionCall, string treeNodeNamePrefix, TreeNodeCollection treeNodeCollection, bool addDummyChildNode)
 {
     if (functionCall == null || functionCall.cirFunction == null)
         return null;
     var cirFunction = functionCall.cirFunction;
     
     var treeNodeName = String.Format(" {0}{1} :                {2}", treeNodeNamePrefix, cirFunction.FunctionName, cirFunction.ClassNameFunctionNameAndParameters);
     var newTreeNode = O2Forms.newTreeNode(treeNodeCollection, treeNodeName, cirFunction.FunctionSignature, 0, functionCall);
     if (addDummyChildNode)
         newTreeNode.Nodes.Add(""); // Dummy node so that we have the plus sign
     if (functionCall.fileName != null && functionCall.lineNumber > 0)
         newTreeNode.ForeColor = System.Drawing.Color.DarkGreen;
     else
         newTreeNode.ForeColor = System.Drawing.Color.Red;
     return newTreeNode;            
 }
Exemplo n.º 5
0
        public static void addToNode_MakesCallsTo(ICirFunctionCall functionCall, TreeNode targetTreeNode, bool alwaysAddDummyChildNode, bool addDontAddRecursiveCalls)
        {
            var cirFunction = functionCall.cirFunction;
            var parentNodes = O2Forms.getStringListWithAllParentNodesName(targetTreeNode);

            //foreach (var makesCallsTo in cirFunction.FunctionsCalledUniqueList)
            foreach (var makesCallsTo in cirFunction.FunctionsCalled)
            {
                var recursiveCall = parentNodes.Contains(makesCallsTo.cirFunction.FunctionSignature);
                if (recursiveCall && addDontAddRecursiveCalls)
                {
                    var nodeText = string.Format("R: {0} : {1} : {2}", makesCallsTo.cirFunction.FunctionName, "....(Recursive Call so not expanding child calls", makesCallsTo.cirFunction.FunctionSignature);
                    targetTreeNode.Nodes.Add(nodeText);
                }
                else
                {
                    addCirFunctionToTreeNodeCollection(makesCallsTo, "=> ", targetTreeNode.Nodes,
                                                       alwaysAddDummyChildNode || makesCallsTo.cirFunction.FunctionsCalled.Count > 0);
                }
            }
        }
Exemplo n.º 6
0
 public static void onBeforeExpand(TreeNode selectedTreeNode, O2Thread.FuncVoidT1T2T3T4 <ICirFunctionCall, TreeNode, bool, bool> addToNodeFunction, bool dontAddRecursiveCalls)
 {
     if (selectedTreeNode != null)
     {
         ICirFunctionCall functionCall = null;
         if (selectedTreeNode.Tag is ICirFunctionCall)
         {
             functionCall = (ICirFunctionCall)selectedTreeNode.Tag;
             //addToNode_MakesCallsTo(functionCall, selectedTreeNode, false);
         }
         else if (selectedTreeNode.Tag is ICirFunction)
         {
             selectedTreeNode.Nodes.Clear();
             functionCall = new CirFunctionCall((ICirFunction)selectedTreeNode.Tag);
         }
         if (functionCall != null)
         {
             selectedTreeNode.Nodes.Clear();
             addToNodeFunction(functionCall, selectedTreeNode, false, dontAddRecursiveCalls);
         }
     }
 }
        public static void raiseSourceCodeReferenceEvent(bool raiseEvent, ICirFunctionCall functionCall, bool remapLineNumber)
        {
            if (raiseEvent)
                if (functionCall.cirFunction != null && functionCall.fileName != null && functionCall.lineNumber > -1)
                {

                    int mappedLineNumber = GetMappedLineNumber(functionCall.cirFunction.FunctionName, functionCall.fileName, functionCall.lineNumber, false, remapLineNumber);
                    O2Messages.fileOrFolderSelected(functionCall.fileName, mappedLineNumber);
                }
        }
        public static void addToNode_MakesCallsTo(ICirFunctionCall functionCall, TreeNode targetTreeNode, bool alwaysAddDummyChildNode, bool addDontAddRecursiveCalls)
        {
            var cirFunction = functionCall.cirFunction;            
            var parentNodes =  O2Forms.getStringListWithAllParentNodesName(targetTreeNode);                        

            //foreach (var makesCallsTo in cirFunction.FunctionsCalledUniqueList)
            foreach (var makesCallsTo in cirFunction.FunctionsCalled)
            {
                var recursiveCall = parentNodes.Contains(makesCallsTo.cirFunction.FunctionSignature);
                if (recursiveCall && addDontAddRecursiveCalls)
                {
                    var nodeText = string.Format("R: {0} : {1} : {2}", makesCallsTo.cirFunction.FunctionName, "....(Recursive Call so not expanding child calls", makesCallsTo.cirFunction.FunctionSignature);
                    targetTreeNode.Nodes.Add(nodeText);
                }
                else
                    addCirFunctionToTreeNodeCollection(makesCallsTo, "=> ", targetTreeNode.Nodes,
                        alwaysAddDummyChildNode || makesCallsTo.cirFunction.FunctionsCalled.Count > 0);
            }
        }
 public static void addToNode_IsCalledBy(ICirFunctionCall functionCall, TreeNode targetTreeNode, bool alwaysAddDummyChildNode, bool dontAddRecursiveCalls)
 {
     // NOTE: dontAddRecursiveCalls not implemented (yet)
     var cirFunction = functionCall.cirFunction;
     foreach (var isCalledBy in cirFunction.FunctionIsCalledBy)
         addCirFunctionToTreeNodeCollection(isCalledBy,  "<= ", targetTreeNode.Nodes,
             alwaysAddDummyChildNode || isCalledBy.cirFunction.FunctionIsCalledBy.Count > 0);                            
 }