Ejemplo n.º 1
0
 private void buttonStart_Click(object sender, RoutedEventArgs e)
 {
     if (Check.CheckIfEmpty(textBoxSourceFolder.Text) && Check.CheckIfEmpty(textBoxDestinationFolder.Text) && Check.CheckIfEmpty(textBoxErrorFolder.Text))
     {
         if (Check.CheckIfDirExists(textBoxSourceFolder.Text) && Check.CheckIfDirExists(textBoxDestinationFolder.Text) && Check.CheckIfDirExists(textBoxErrorFolder.Text))
         {
             if (directories.Count > 0)
             {
                 string duplicationExtra = "none";
                 if (radioButtonChecksumMD5.IsChecked == true)
                 {
                     duplicationExtra = "md5";
                 }
                 else if (radioButtonChecksumSHA1.IsChecked == true)
                 {
                     duplicationExtra = "sha1";
                 }
                 else if (radioButtonChecksumSHA256.IsChecked == true)
                 {
                     duplicationExtra = "sha256";
                 }
                 else if (radioButtonChecksumSHA512.IsChecked == true)
                 {
                     duplicationExtra = "sha512";
                 }
                 Organizing organizing = new Organizing(sourceFolder, textBoxDestinationFolder.Text, textBoxErrorFolder.Text, directories, fileHandler.maximum, duplicationExtra);
                 organizing.ShowDialog();
             }
             else
             {
                 MessageBox.Show("Please search for files first or use a folder that contains files!");
             }
         }
         else
         {
             MessageBox.Show("Please enter valid path for source, destination and error folder!");
         }
     }
     else
     {
         MessageBox.Show("Please enter source, destination and error folder!");
     }
 }
Ejemplo n.º 2
0
        private void worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            listBoxScan.ItemsSource = directories;
            labelCount.Content      = directories.Count();
            IsLoading             = false;
            progressBarScan.Value = 0;

            if (checkBoxAutoStart.IsChecked == true && directories.Count > 0)
            {
                string duplicationExtra = "none";
                if (radioButtonChecksumMD5.IsChecked == true)
                {
                    duplicationExtra = "md5";
                }
                else if (radioButtonChecksumSHA1.IsChecked == true)
                {
                    duplicationExtra = "sha1";
                }
                else if (radioButtonChecksumSHA256.IsChecked == true)
                {
                    duplicationExtra = "sha256";
                }
                else if (radioButtonChecksumSHA512.IsChecked == true)
                {
                    duplicationExtra = "sha512";
                }
                Organizing organizing = new Organizing(sourceFolder, destinationFolder, errorFolder, directories, fileHandler.maximum, duplicationExtra);
                organizing.ShowDialog();
            }

            // enable input
            buttonBrowseSourceFolder.IsEnabled      = true;
            buttonBrowseDestinationFolder.IsEnabled = true;
            buttonBrowseErrorFolder.IsEnabled       = true;
            textBoxSourceFolder.IsEnabled           = true;
            textBoxDestinationFolder.IsEnabled      = true;
            textBoxErrorFolder.IsEnabled            = true;
            buttonStart.IsEnabled       = true;
            buttonScan.Content          = "Scan";
            checkBoxAutoStart.IsChecked = false;
        }