Exemple #1
0
        private void ToolStripMenuItem_Class_Click(object sender, EventArgs e)
        {
            Form_Class form = new Form_Class();

            form.MdiParent   = this;
            form.MaximizeBox = true;
            form.Show();
        }
Exemple #2
0
        // 为输入的分类与匹配简表短分类号
        private void Match(string outputStyle)
        {
            this.bStop = false;

            if (this.ClassList.Count == 0)
            {
                MessageBox.Show(this, "尚未加载简表");
                return;
            }

            DateTime startTime = DateTime.Now;

            this.textBox_result.Text = "";
            string[] lines = Form_Class.GetLines(this.textBox_inputClass.Text.Trim());

            int totalCount = lines.Length;

            this.toolStripProgressBar1.Maximum = totalCount;
            this.toolStripProgressBar1.Minimum = 0;
            int count = 0;

            foreach (string line in lines)
            {
                if (bStop == true)
                {
                    MessageBox.Show(this, "用户中断,当前处理到第" + count + "个");
                    break;
                }

                count++;
                this.toolStripProgressBar1.Value = count;
                this.toolStripStatusLabel1.Text  = count.ToString() + "/" + totalCount;
                ClassItem classItem  = null;
                string    outputInfo = this.SearchClass(line, outputStyle, out classItem);
                this.textBox_result.Text += outputInfo;

                // 出让控制权
                Application.DoEvents();
            }

            TimeSpan timeLength = DateTime.Now - startTime;

            this.toolStripStatusLabel1.Text += "共用时" + timeLength.TotalSeconds.ToString();
        }