コード例 #1
0
 private void backgroundComparator_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     buttonCompare.Enabled = true;
     labelProgress.Text    = "";
     if (currentWork != null)
     {
         OpenSubfolder(currentWork.OutputPath);
         currentWork = null;
     }
 }
コード例 #2
0
        private void buttonCompare_Click(object sender, EventArgs e)
        {
            if (backgroundComparator.IsBusy)
            {
                MessageBox.Show("아직 이전 작업이 끝나지 않았습니다!");
                return;
            }

            var newWork = new ComparisonWork
            {
                NewFile    = textNewFile.Text,
                OldFile    = textOldFile.Text,
                OutputPath = textOutputFolder.Text
            };

            if (!File.Exists(newWork.NewFile))
            {
                MessageBox.Show("새 파일을 선택해주세요.");
                textNewFile.Focus();
                return;
            }
            if (!File.Exists(newWork.OldFile))
            {
                MessageBox.Show("새 파일을 선택해주세요.");
                textOldFile.Focus();
                return;
            }
            if (!Directory.Exists(newWork.OutputPath))
            {
                MessageBox.Show("결과를 저장할 폴더를 선택해주세요.");
                textOutputFolder.Focus();
                return;
            }

            currentWork           = newWork;
            buttonCompare.Enabled = false;
            backgroundComparator.RunWorkerAsync();
        }