Exemplo n.º 1
0
        void hashAdder_ProcessStateChanged(object sender, ProcessStateEventArgs e)
        {
            if (e == null)
            {
                return;
            }
            switch (e.CurrentState)
            {
            case ProcessState.Started:
                this.BeginInvoke(new ThreadStart(delegate()
                {
                    btnAdd.Enabled    = false;
                    progressAdd.Style = ProgressBarStyle.Marquee;
                }));
                break;

            case ProcessState.Processing:
                this.BeginInvoke(new ThreadStart(delegate()
                {
                    txtCurrentFile.Text = e.CurrentFile;
                }));
                break;

            case ProcessState.Completed:
                this.BeginInvoke(new ThreadStart(delegate()
                {
                    progressAdd.Style = ProgressBarStyle.Blocks;
                    MessageBox.Show(this, "Hash值添加完成");
                    btnAdd.Enabled = true;
                    hashAdder.ProcessStateChanged -= hashAdder_ProcessStateChanged;
                }));
                break;

            default:
                break;
            }
        }
Exemplo n.º 2
0
        void hashMerge_ProcessStateChanged(object sender, ProcessStateEventArgs e)
        {
            if (e == null)
            {
                return;
            }
            switch (e.CurrentState)
            {
            case ProcessState.Started:
                this.BeginInvoke(new ThreadStart(delegate()
                {
                    btnMerge.Enabled = false;
                    pbMerge.Style    = ProgressBarStyle.Marquee;
                }));
                break;

            case ProcessState.Processing:
                this.BeginInvoke(new ThreadStart(delegate()
                {
                    txtMergeFile.Text = e.CurrentFile;
                }));
                break;

            case ProcessState.Completed:
                this.BeginInvoke(new ThreadStart(delegate()
                {
                    pbMerge.Style = ProgressBarStyle.Blocks;
                    MessageBox.Show(this, "合并去重完成");
                    btnMerge.Enabled = true;
                    hashMerge.ProcessStateChanged -= columnExtractor_ProcessStateChanged;
                }));
                break;

            default:
                break;
            }
        }