コード例 #1
0
 private void folderCheckBtn_Click_1(object sender, EventArgs e)
 {
     if (string.IsNullOrWhiteSpace(this.textBoxFolder1.Text) || string.IsNullOrEmpty(this.textBoxFolder1.Text) ||
         string.IsNullOrWhiteSpace(this.textBoxFolder2.Text) || string.IsNullOrEmpty(this.textBoxFolder2.Text)) //Make sure that the fields are not empty
     {
         MessageBox.Show("Please enter a path for both fields");
         return;
     }
     FileChoiceForm cForm = fireUpFileChoice();
 }
コード例 #2
0
        FileChoiceForm fireUpFileChoice()
        {
            string[][] resultFiles     = folderCompare(textBoxFolder1.Text, textBoxFolder2.Text).ToArray();
            string[][] identicalFiles  = new string[2][];
            string[]   identicalFiles1 = new string[resultFiles.GetLength(0)];
            string[]   identicalFiles2 = new string[resultFiles.GetLength(0)];
            for (int i = 0; i < resultFiles.GetLength(0); i++)
            {
                identicalFiles1[i] = resultFiles[i][0];
                identicalFiles2[i] = resultFiles[i][1];
            }
            identicalFiles[0] = identicalFiles1;
            identicalFiles[1] = identicalFiles2;
            FileChoiceForm choiceForm = new FileChoiceForm(textBoxFolder1.Text, textBoxFolder2.Text, identicalFiles);

            if (identicalFiles != null)
            {
                choiceForm.Show();
            }

            return(choiceForm);
        }