Exemple #1
0
        public void treeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            TreeNode assemblyNode = e.Node.FirstParentNode();

            if (MainForm.CurrentAssembly == null || MainForm.CurrentAssembly.ManifestModule != assemblyNode.Tag as ModuleDefMD)
            {
                AnalysisHandler.Reset();

                MainForm.CurrentAssembly      = new CurrentAssembly(assemblyNode.Tag as ModuleDefMD);
                MainForm.CurrentAssembly.Path = assemblyNode.ToolTipText;

                if (e.Node.ModuleNode() != null)
                {
                    CurrentModule = e.Node.ModuleNode();
                }
            }

            if (e.Node.Tag is MethodDef)
            {
                var method = e.Node.Tag as MethodDef;

                if (CurrentMethod == null || method != CurrentMethod.Tag as MethodDef)
                {
                    ILSpyHandler.Clear();
                    DataGridViewHandler.ReadMethod(method);
                    CurrentMethod = e.Node;

                    NavigationHistory.AddPastHistory(method);
                }
            }
            else
            {
                CurrentMethod = null;
                MainForm.CurrentAssembly.Method = null;
                DataGridViewHandler.ClearInstructions();
                VariableHandler.ClearVariables();
                ILSpyHandler.Clear();
            }

            SelectedNode = e.Node;
        }