Exemple #1
0
        public static void SearchEventBGWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            if (e.ProgressPercentage == 0)
            {
                EventTable.Rows.Clear();
                Helper.Form.dataGridView1.DataSource = SearchEvent.EventTable;
            }

            string text  = e.UserState.ToString();
            string state = text.Substring(0, e.UserState.ToString().IndexOf(": ", StringComparison.Ordinal));

            switch (state)
            {
            case "Log":
                Helper.Report(text.Replace("Log: ", ""));
                break;

            case "Event":
                string[] t = text.Replace("Event:", "").Explode(" ||| ");
                if (!_event.CanAddListItem(t))
                {
                    break;
                }

                Helper.AddListItem(EventTable, t);
                break;

            case "Time":
                Helper.Form.lblTime.Text = text.Replace("Time: ", "") + "s";
                break;

            case "Counter":
                Helper.SetResultCount(text.Replace("Counter: ", ""));
                break;

            case "Piracy":
                Helper.Form.lblKMS.Text      = text.Replace("Piracy:", "");
                Helper.Form.lblKMS.ForeColor = Color.Red;
                break;
            }
        }