Exemple #1
0
        private void StartSearch()
        {
            if (_boxSearchText.Text != String.Empty)
            {
                _buttonSearch.Enabled = false;
                _progressBar.Visible  = true;
                this.Text             = _boxSearchText.Text;

                //configure the search
                SearchType type = (SearchType)_dropType.SelectedIndex;
                _search = new Search(_boxSearchText.Text, _checkIsRegex.Checked, type, _boxDescriptionFilter.Text);
                _last   = 0;
                _list.Items.Clear();

                //run the background worker
                _searchWorker.RunWorkerAsync();

                //start the load timer
                _requestTimerStop = false;
                _timer.Start();

                //invoke the event
                if (SearchExecuted != null)
                {
                    SearchExecuted.Invoke(new SearchExecutedEventArgs(_boxSearchText.Text, _checkIsRegex.Checked));
                }
            }
        }
Exemple #2
0
        private void StartSearch()
        {
            if (_boxSearchText.Text != String.Empty)
            {
                _matches = new LineMatches();

                _buttonSearch.Enabled = false;
                _progressBar.Visible  = true;
                this.Text             = _boxSearchText.Text;

                //configure the search
                SearchContext context = (SearchContext)_dropType.SelectedIndex;
                TrafficViewerOptions.Instance.LastSearchType = _dropType.SelectedIndex;

                _searcher = new LineSearcher();
                //clear the search caches
                SearchResultCache.Instance.Clear();
                SearchSubsetsCache.Instance.Clear();



                _criteriaSet = new SearchCriteriaSet();

                _criteriaSet.DescriptionFilter = _boxDescriptionFilter.Text;

                string[] searchLines = _boxSearchText.Text.Split(new char[2] {
                    '\r', '\n'
                }, StringSplitOptions.RemoveEmptyEntries);

                _criteriaSet.Add(new TrafficViewerSDK.Search.SearchCriteria(context,
                                                                            _checkIsRegex.Checked, searchLines));


                _last = 0;
                _list.Items.Clear();

                //run the background worker
                _searchWorker.RunWorkerAsync();

                //start the load timer
                _requestTimerStop = false;
                _timer.Start();

                //invoke the event
                if (SearchExecuted != null)
                {
                    SearchExecuted.Invoke(new SearchExecutedEventArgs(_boxSearchText.Text, _checkIsRegex.Checked));
                }
            }
        }