Exemplo n.º 1
0
 private void tvExecutionArchive_AfterSelect(object sender, TreeViewEventArgs e)
 {
     if (tvExecutionArchive.SelectedNode != null && tvExecutionArchive.SelectedNode.Tag != null && tvExecutionArchive.SelectedNode.Tag is List <O2MDbgThread> )
     {
         var threads = (List <O2MDbgThread>)tvExecutionArchive.SelectedNode.Tag;
         if (threads.Count > 0)
         {
             if (threads[0].sourceCodeMappings != null && threads[0].sourceCodeMappings.Count > 0)
             {
                 var file       = threads[0].sourceCodeMappings[0].FileName;
                 var lineNumber = threads[0].sourceCodeMappings[0].Line;
                 O2.Kernel.CodeUtils.O2Messages.fileOrFolderSelected(file, lineNumber);
             }
             showThreadDetails(threads);
             O2Forms.SetFocusOnControl(this, 50);
         }
     }
 }
Exemplo n.º 2
0
        private void functionsViewer__onAfterSelect(object selectedItem)
        {
            currentSelectedFunction = null;
            var type = selectedItem.GetType().FullName;

            showFunctionInformation(selectedItem);
            //this.invokeOnThread(
            //   ()=>
            //      {
            //if (selectedItem)
            //var signatureToProcess = "";
            if (selectedItem is List <FilteredSignature> ) // it is a class
            {
                var selectedItems = (List <FilteredSignature>)selectedItem;
                if (selectedItems.Count > 0)
                {
                    var          filteredSignature = (FilteredSignature)selectedItems[0];
                    ICirFunction cirFunction       = null;
                    //first check if we have a match on sSignature then on sOriginalSignature
                    if (cirDataAnalysis.dCirFunction_bySignature.ContainsKey(filteredSignature.sSignature))
                    {
                        cirFunction = cirDataAnalysis.dCirFunction_bySignature[filteredSignature.sSignature];
                    }
                    else if (cirDataAnalysis.dCirFunction_bySignature.ContainsKey(filteredSignature.sOriginalSignature))
                    {
                        cirFunction = cirDataAnalysis.dCirFunction_bySignature[filteredSignature.sOriginalSignature];
                    }
                    if (cirFunction != null)
                    {
                        if (cirFunction.ParentClass != null)
                        {
                            ViewHelpers.raiseSourceCodeReferenceEvent(openSourceCodeFileAndSelectLineToolStripMenuItem.Checked, cirFunction.ParentClass, true /* remapLineNumber */);
                        }
                        else
                        {
                        }
                    }
                }
            }
            else
            {
                var cirFunctionToProcess = mapFilteredSignatureToCirFunction(selectedItem);
                if (cirFunctionToProcess != null)
                {
                    currentSelectedFunction = cirFunctionToProcess;
                    ViewHelpers.raiseSourceCodeReferenceEvent(openSourceCodeFileAndSelectLineToolStripMenuItem.Checked, cirFunctionToProcess, true /* remapLineNumber */);
                    if (showFunctionsDecompiledCodeInSourceCodeViewerToolStripMenuItem.Checked)
                    {
                        DecompiledCode.showDecompiledFunctionInSourceCodeViewer(cirFunctionToProcess, "Decompiled .NET Function");
                    }
                }
            }


            //O2Forms.SetFocusOnControl(functionsViewer, 200);
            O2Forms.SetFocusOnControl(this, 400);



            //     })

            //ascx_FunctionCalls.
            //showSelectedItemDetails(selectedItem);
        }