Esempio n. 1
0
        private void selectFolder_click(object sender, RoutedEventArgs e)
        {
            var          dialog = new FolderBrowserDialog();
            DialogResult result = dialog.ShowDialog();

            if (Directory.Exists(dialog.SelectedPath))
            {
                Directories.mainDirPath = dialog.SelectedPath;
                pathTextBlock.Text      = dialog.SelectedPath;
            }
            else // Fuse for folder which doesn't exist
            {
                //while (!Directory.Exists(dialog.SelectedPath))
                //{
                if (System.Windows.MessageBox.Show("Selected Directory \"" + System.IO.Path.GetFileName(dialog.SelectedPath) + "\" doesn't exists! Do you want to create the directory ?", "Create Directories Confirmation", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                {
                    Directories.CheckIfFolderExists(dialog.SelectedPath);
                    Directories.mainDirPath = dialog.SelectedPath;
                    pathTextBlock.Text      = dialog.SelectedPath;
                }
                else
                {
                    pathTextBlock.Text = Directories.mainDirPath;
                }
                //}
            }
        }
Esempio n. 2
0
 public static void SaveToFiles(string dirPath)
 {
     // Save all files
     foreach (FileObject file in files)
     {
         Directories.CheckIfFolderExists(dirPath);
         File.WriteAllLines(dirPath + "\\" + file.Name, file.Lines);
     }
 }
Esempio n. 3
0
 private void loadFiles_click(object sender, RoutedEventArgs e)
 {
     for (int i = 0; i < 2; i++)
     {
         Directories.CheckIfFolderExists(Directories.GetPath(i));
         Merger.GetFiles(Directories.GetPath(i), i);
     }
     if (listView_FileList.Items.Count > 0)
     {
         selectFolder.IsEnabled = false;
         loadFiles.IsEnabled    = false;
         flushFiles.IsEnabled   = true;
         saveFiles.IsEnabled    = true;
     }
 }