private void ListaPesquisa_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (ListaPesquisa.SelectedItems.Count > 0)
            {
                IDpesquisa = ListaPesquisa.SelectedItems[0].Text;
            }

            Status ST = new Status(IDpesquisa);
            ST.ShowDialog();
        }
Exemple #2
0
 private void bt_pause_Click(object sender, EventArgs e)
 {
     _Status = Status.Pausing;
 }
Exemple #3
0
        private void step_Tick(object sender, EventArgs e)
        {
            if (_Status == Status.Running)
            {
                while (_Searchers.Count < _SearchWords.Count && _Searches + 12 > _Searchers.Count )
                {
                    _Searchers.Add(new BackgroundWorker());
                    _Searchers[_Searchers.Count - 1].DoWork += new DoWorkEventHandler(RunThread);
                    _Searchers[_Searchers.Count - 1].RunWorkerAsync();
                }
            }
            if (_Status == Status.Pausing)
            {
                bool done = true;
                foreach (BackgroundWorker bg in _Searchers)
                    if (bg.IsBusy)
                        done = false;
                if (done) _Status = Status.Paused;
            }

            if (_Status == Status.Running)
            {
                if (lb_dictionary.Items[0].ToString() != "Running...")
                {
                    lb_dictionary.Items.Clear();
                    lb_dictionary.Items.Add("Running...");
                }
                if (lb_swords.Items[0].ToString() != "Running...")
                {
                    lb_swords.Items.Clear();
                    lb_swords.Items.Add("Running...");
                }
            }
            if (_Status == Status.Paused)
            {
                if (lb_dictionary.Items[0].ToString() == "Running...")
                {
                    lb_dictionary.Items.Clear();
                    _Words.Sort();
                    List<string> words = _Words.Words;
                    for (int i = 0; i < 1000 && i < words.Count; i++)
                    {
                        string word = words[i];
                        lb_dictionary.Items.Add(_Words.Frequency(word) + " " + word);
                    }
                }
                if (lb_swords.Items[0].ToString() == "Running...")
                {
                    lb_swords.Items.Clear();
                    for (int i = _Searches - 1; i >= 0 && i > _Searches - 1000; i--)
                    {
                        string word = _SearchWords[i];
                        lb_swords.Items.Add(word);
                    }
                }
            }

            lb_status.Text = "Status: " + _Status.ToString();
            lb_words.Text = "Words: " + _Words.Count.ToString();
            lb_searches.Text = "Searches: " + _Searches.ToString();

            bt_pause.Enabled = _Status == Status.Running;
            bt_start.Enabled = _Status != Status.Running;
        }
Exemple #4
0
 private void bt_start_Click(object sender, EventArgs e)
 {
     if (_SearchWords.Count == 0) _StartUp.RunWorkerAsync();
     _Status = Status.Running;
 }
 public CalculatorMessage(Status status, string body, string meta)
 {
     this.status = status;
     this.body = body;
     this.meta = meta;
 }
 public CalculatorMessage(Status status, string body)
 {
     this.status = status;
     this.body = body;
 }