Exemplo n.º 1
0
        public void closeToolStripMenuItem_Click(object sender, EventArgs e, ref CurrentAssembly currentAssembly)
        {
            //TODO: Update on changes

            if (SelectedNode == null)
            {
                return;
            }

            TreeNode assembly = SelectedNode.FirstParentNode();

            if (assembly == null)
            {
                return;
            }

            CurrentMethod   = null;
            CurrentModule   = null;
            currentAssembly = null;
            DataGridViewHandler.ClearInstructions();
            VariableHandler.ClearVariables();
            ILSpyHandler.Clear();
            AnalysisHandler.Reset();
            assembly.Remove();
        }
Exemplo n.º 2
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;
        }