예제 #1
0
파일: Search.cs 프로젝트: jpmac26/LazyShell
 /// <summary>
 /// Loads a search form containing the results of a search query.
 /// </summary>
 /// <param name="indexNum">The search index control to update when a search result is selected.</param>
 /// <param name="searchField">The search field control containing the search query text.</param>
 /// <param name="searchButton">The search button control that invokes the search.</param>
 /// <param name="performSearch">The function to execute when a search is invoked.</param>
 /// <param name="resultWindow">The type of control that contains the search results.
 /// Options include: ListBox, TreeView, TextBox</param>
 public Search(Controls.NewToolStripNumericUpDown indexNum, ToolStripButton searchButton, Delegate performSearch, Type resultWindow)
 {
     InitializeComponent();
     this.indexNum     = indexNum;
     this.searchButton = searchButton;
     InitializeControls();
     this.performSearch = performSearch;
     this.replaceWithSeparator.Visible = resultWindow == typeof(TextBox);
     this.replaceWithLabel.Visible     = resultWindow == typeof(TextBox);
     this.replaceAllButton.Visible     = resultWindow == typeof(TextBox);
     this.replaceWithText.Visible      = resultWindow == typeof(TextBox);
     if (resultWindow == typeof(ListBox))
     {
         this.listBox.Enabled = true;
         this.listBox.Show();
         this.listBox.BringToFront();
         this.performSearch.DynamicInvoke(searchForText.Text, listBox, stringComparison, matchWholeWord.Checked);
     }
     else if (resultWindow == typeof(TreeView))
     {
         this.treeView.Enabled = true;
         this.treeView.Show();
         this.treeView.BringToFront();
         this.performSearch.DynamicInvoke(searchForText.Text, treeView, stringComparison, matchWholeWord.Checked);
     }
     else if (resultWindow == typeof(TextBoxBase))
     {
         this.searchTextBox.Enabled = true;
         this.searchTextBox.Show();
         this.searchTextBox.BringToFront();
         this.performSearch.DynamicInvoke(searchForText.Text, searchTextBox, stringComparison, matchWholeWord.Checked, false, "");
     }
     this.Location = searchButtonLocation;
     StartTimer();
 }
예제 #2
0
        // Constructor
        public EditLabel(ToolStripControlHost name, Controls.NewToolStripNumericUpDown number, string element, bool canEditLabel)
        {
            InitializeComponent();
            var labelToolStrip = NewLabelToolStrip(canEditLabel);

            if (name != null)
            {
                try
                {
                    this.name = name.Control as ComboBox;
                    this.name.ContextMenuStrip      = labelToolStrip;
                    this.name.SelectedIndexChanged += new EventHandler(name_SelectedIndexChanged);
                }
                catch
                {
                    var textbox = name.Control as TextBox;
                    textbox.ContextMenuStrip = labelToolStrip;
                }
            }
            if (number != null)
            {
                this.num = number;
                this.num.ContextMenuStrip = labelToolStrip;
                this.num.ValueChanged    += new EventHandler(num_ValueChanged);
            }
            SetElement(element);
            RefreshLabel();
            //
            this.Location = editLabelLocation;
            InitializeTimer();
        }
예제 #3
0
 public History(Form form, ToolStripControlHost name, Controls.NewToolStripNumericUpDown number)
 {
     this.form   = form;
     this.name   = name;
     this.number = number;
     InitializeApplicationHistory();
     InitializeEventHandlers();
 }
예제 #4
0
파일: Search.cs 프로젝트: jpmac26/LazyShell
 // Constructors
 /// <summary>
 /// Loads a search form containing the results of a search query.
 /// </summary>
 /// <param name="indexNum">The search index control to update when a search result is selected.</param>
 /// <param name="searchField">The search field control containing the search query text.</param>
 /// <param name="searchButton">The search button control that invokes the search.</param>
 /// <param name="names">The data list to search for a specified query in.</param>
 public Search(Controls.NewToolStripNumericUpDown indexNum, ToolStripButton searchButton, IList names)
 {
     InitializeComponent();
     this.listBox.Enabled = true;
     this.listBox.Show();
     this.listBox.BringToFront();
     this.Names        = names;
     this.indexNum     = indexNum;
     this.searchButton = searchButton;
     InitializeControls();
     PerformSearch();
     this.performSearch = new SearchFunction(PerformSearch);
     this.performSearch.DynamicInvoke();
     this.Location = searchButtonLocation;
     StartTimer();
 }
예제 #5
0
 // Constructor
 public HackingTools(Delegate update, Controls.NewToolStripNumericUpDown index)
 {
     this.update = update;
     this.index  = index;
     InitializeComponent();
 }