コード例 #1
0
        private void OpenToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            ResultsForm resultsForm = new ResultsForm("File");

            if (!resultsForm.IsDisposed && resultsForm.DialogResult == DialogResult.Retry)
            {
                resultsForm.ShowDialog();
            }
            if (resultsForm.DialogResult == DialogResult.OK)
            {
                ReloadWorkspace(false);
                //Main_Instance.Instance.NodeDiagram.AutoLayout(false);
            }
            //resultsForm.ShowDialog();
        }
コード例 #2
0
        private void btnOpenResult_Click(object sender, EventArgs e)
        {
            ResultsForm frm = new ResultsForm("File");

            frm.TopLevel        = false;
            frm.Visible         = true;
            frm.FormBorderStyle = FormBorderStyle.None;
            frm.Dock            = DockStyle.Fill;
            TabPage myTabPage = new TabPage("Results");

            myTabPage.Controls.Add(frm);
            myTabPage.Padding   = new System.Windows.Forms.Padding(3);
            myTabPage.BackColor = System.Drawing.Color.DodgerBlue;

            this.tabControl.TabPages.Add(myTabPage);
            this.tabControl.SelectedTab = Main_Instance.Instance.MainForm_Instance.tabControl.TabPages[Main_Instance.Instance.MainForm_Instance.tabControl.TabPages.Count - 1];
            this.SetTabHeader(myTabPage, Color.DodgerBlue);
        }
コード例 #3
0
 private void MyMenuItem_Click(object sender, EventArgs e)
 {
     if (((MenuItem)sender).Text == "Embedded Browser" && selectedNode != null)
     {
         if (selectedNode.Text.Contains("http:") || selectedNode.Text.Contains("https:"))
         {
             AddNewTab(selectedNode.Parent != null ? selectedNode.Parent.Text.Substring(0, 8) : selectedNode.Text.Split(':')[1].Substring(2, 10), selectedNode.Text);
         }
     }
     if (((MenuItem)sender).Text == "Default Browser" && selectedNode != null)
     {
         if (selectedNode.Text.Contains("http:") || selectedNode.Text.Contains("https:"))
         {
             ResultsForm.OpenUrl(selectedNode.Text);
         }
     }
     else if (((MenuItem)sender).Text == "Copy" && selectedNode != null)
     {
         Clipboard.SetText(treeViewTargets.SelectedNode.Text);
     }
     else if (((MenuItem)sender).Text == "Delete" && selectedNode != null)
     {
         treeViewTargets.Nodes.Remove(selectedNode);
         Main_Instance.Instance.Workspace.ReloadTargetsFromTreeView();
         ReloadWorkspace(true);
     }
     else if (((MenuItem)sender).Text == "Compose Query" && selectedNode != null)
     {
         List <TreeNode> selectedNodes = new List <TreeNode>();
         selectedNodes.Add(selectedNode);
         Main_Instance.Instance.compose_funcion(selectedNodes);
     }
     else if (((MenuItem)sender).Text == "New Empty Child" && selectedNode != null)
     {
         selectedNode.Nodes.Add(new TreeNode("Empty"));
         selectedNode.Expand();
         Main_Instance.Instance.Workspace.ReloadTargetsFromTreeView();
         ReloadWorkspace(true);
     }
     else
     {
         //Main_Instance.Instance.Workspace.findTarget(((MenuItem)sender).Text).TreeNodes.Add(selectedNode);
     }
 }
コード例 #4
0
 public MyCustomMenuHandler(ResultsForm resultsForm)
 {
     this.resultsForm = resultsForm;
 }
コード例 #5
0
        private void button2_Click(object sender, EventArgs e)
        {
            //SEARCH Modules
            //listModules.CheckedItems.
            List <ISearchable_module> searchables = new List <ISearchable_module>();

            foreach (string module in listModules.CheckedItems)
            {
                if (Main_Instance.Instance.Module_list[General_Config.Module_Type.Search][listModules.Items.IndexOf(module)].GetType().GetInterfaces().Contains(typeof(ISearchable_module)))
                {
                    searchables.Add((ISearchable_module)Main_Instance.Instance.Module_list[General_Config.Module_Type.Search][listModules.Items.IndexOf(module)]);
                }
            }/*
              * Query_InsertForm query_InsertForm;
              * if (premade_query != null)
              * {
              * query_InsertForm = new Query_InsertForm(searchables, premade_query);
              * }
              * else
              * {
              * query_InsertForm = new Query_InsertForm(searchables);
              * }
              * query_InsertForm.ShowDialog();
              * var result = query_InsertForm.DialogResult;
              * if (result == DialogResult.OK)
              * {
              * string query = query_InsertForm.query;
              * List<object> extras = query_InsertForm.extras;
              * SearchingForm searchingForm = new SearchingForm(searchables, query, extras);
              * searchingForm.ShowDialog();
              * query_InsertForm.Close();
              *
              * result = searchingForm.DialogResult;
              *
              * if (result == DialogResult.OK)
              * {
              *     List<SearchResult> searchResults = searchingForm.searchResults;
              *     ResultsForm resultsForm = new ResultsForm(searchResults);
              *     resultsForm.ShowDialog();
              * }
              * //Do something here with these values
              * }
              * if (result == DialogResult.Cancel)
              * {
              * query_InsertForm.Close();
              * }*/

            SearchingForm searchingForm = new SearchingForm(searchables, txtQuery.Text, new List <object>());

            var result = searchingForm.ShowDialog();

            if (result == DialogResult.OK)
            {
                List <SearchResult> searchResults = searchingForm.searchResults;
                //ResultsForm resultsForm = new ResultsForm(searchResults);
                //resultsForm.ShowDialog();

                ResultsForm frm = new ResultsForm(searchResults);
                frm.TopLevel        = false;
                frm.Visible         = true;
                frm.FormBorderStyle = FormBorderStyle.None;
                frm.Dock            = DockStyle.Fill;
                TabPage myTabPage = new TabPage("Results");
                myTabPage.Controls.Add(frm);
                myTabPage.Padding   = new System.Windows.Forms.Padding(3);
                myTabPage.BackColor = System.Drawing.Color.DodgerBlue;

                Main_Instance.Instance.MainForm_Instance.tabControl.TabPages.Add(myTabPage);
                Main_Instance.Instance.MainForm_Instance.tabControl.SelectedTab = Main_Instance.Instance.MainForm_Instance.tabControl.TabPages[Main_Instance.Instance.MainForm_Instance.tabControl.TabPages.Count - 1];
                Main_Instance.Instance.MainForm_Instance.SetTabHeader(myTabPage, Color.DodgerBlue);
                this.DialogResult = DialogResult.OK;
            }
        }