private void modulesToolStripMenuItem1_Click(object sender, EventArgs e) { Show_Modules report_Modules = new Show_Modules(General_Config.Module_Type.Report); var result = report_Modules.ShowDialog(); if (result == DialogResult.OK) { IReport_module report_Module = (IReport_module)report_Modules.selected_module; Select_Nodes select_Nodes = new Select_Nodes(treeViewTargets); var result_nodes = select_Nodes.ShowDialog(); if (result_nodes == DialogResult.OK) { report_Module.GenerateDocument(select_Nodes.selected_nodes); } else { select_Nodes.Hide(); } } else { report_Modules.Hide(); } }
private void myMenuItem_Click(object sender, EventArgs e) { if (((MenuItem)sender).Text == "Remove" && selectedNode != null) { treeViewResults.Nodes.Remove(selectedNode); } else if (((MenuItem)sender).Text == "New Target" && selectedNode != null) { SimpleInputForm newTargetForm = new SimpleInputForm("New Target"); newTargetForm.Location = selectedLocation; newTargetForm.ShowDialog(); if (newTargetForm.DialogResult == DialogResult.OK) { if (newTargetForm.title != "") { Main_Instance.Instance.Workspace.Targets.Add(new Target(newTargetForm.title, selectedNode)); } Main_Instance.Instance.Workspace.ReloadTreeViewFromTargets(); Main_Instance.Instance.MainForm_Instance.ReloadWorkspace(true); //Main_Instance.Instance.Workspace. } } else if (((MenuItem)sender).Text == "Process Module" && selectedNode != null) { Show_Modules process_Modules = new Show_Modules(General_Config.Module_Type.Process); var result = process_Modules.ShowDialog(); if (result == DialogResult.OK) { IProcessing_Module process_Module = (IProcessing_Module)process_Modules.selected_module; treeViewResults.Nodes.Add(process_Module.Process(selectedNode)); } else { process_Modules.Hide(); } } else if (((MenuItem)sender).Text == "Predefined Browser" && selectedNode != null) { if (selectedNode.Text.Contains("http:") || selectedNode.Text.Contains("https:")) { //webBrowser1.Url = new Uri(selectedNode.Text); //txtURL.Text = selectedNode.Text; OpenUrl(selectedNode.Text); //MessageBox.Show(e.Node.Nodes.Count + ""); } else { string url = dig_node_for_url(selectedNode); if (url != null) { OpenUrl(url); } } } else if (((MenuItem)sender).Text == "Chromium" && selectedNode != null) { if (selectedNode.Text.Contains("http:") || selectedNode.Text.Contains("https:")) { browser.Load(selectedNode.Text); } else { string url = dig_node_for_url(selectedNode); if (url != null) { browser.Load(url); } } } else { if (!Main_Instance.Instance.Workspace.FindTarget(((MenuItem)sender).Text).AddNode(selectedNode)) { MessageBox.Show("Current node already exists!"); } Main_Instance.Instance.Workspace.ReloadTreeViewFromTargets(); Main_Instance.Instance.MainForm_Instance.ReloadWorkspace(true); } }