コード例 #1
0
        private async void btnGo_Click(object sender, EventArgs e)
        {
            btnGo.Enabled         = false;
            labelProgress.Text    = string.Empty;
            labelProgress.Visible = true;
            timer1.Enabled        = true;

            var scanner = new DirectoryScanner(txtPath.Text);

            progress = scanner;
            var scanId = await scanner.ScanAsync();

            var scanId2 = await scanner.HashAsync(scanId);

            var dups   = new DuplicationScanner(scanId);
            var result = await dups.ScanAsync();

            var message = string.Format("Count: {0}\nUnique:{1}\nDuplicates:{2}\nConflicts:{3}", result.Count, result.UniqueCount, result.DuplicationCount, result.Multiprocessed);

            MessageBox.Show(message);

            timer1.Enabled        = false;
            btnGo.Enabled         = true;
            labelProgress.Visible = false;
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: Wholing/PictureScanner
        private async void btnGo_Click(object sender, EventArgs e)
        {
            btnGo.Enabled = false;
            labelProgress.Text = string.Empty;
            labelProgress.Visible = true;
            timer1.Enabled = true;

            var scanner = new DirectoryScanner(txtPath.Text);
            progress = scanner;
            var scanId = await scanner.ScanAsync();
            var scanId2 = await scanner.HashAsync(scanId);
            var dups = new DuplicationScanner(scanId);
            var result = await dups.ScanAsync();

            var message = string.Format("Count: {0}\nUnique:{1}\nDuplicates:{2}\nConflicts:{3}", result.Count, result.UniqueCount, result.DuplicationCount, result.Multiprocessed);
            MessageBox.Show(message);

            timer1.Enabled = false;
            btnGo.Enabled = true;
            labelProgress.Visible = false;
        }