Example #1
0
        private void btnCopy_Click(object sender, RoutedEventArgs e)
        {
            var isValidPath = IsValidPath(new List <string>()
            {
                txtSrcPath.Text, txtTargetPath.Text
            });

            rtxtMessage.Document.Blocks.Clear();

            if (cbFileType.SelectedIndex == 0)
            {
                EditRichTextBox("File Type required.", Brushes.Red);
            }
            else if (isValidPath)
            {
                var strMessage = string.Empty;
                switch (fileType)
                {
                case FileType.Photos:
                    strMessage = ProcessFiles.ExecuteProcessFiles(txtSrcPath.Text, txtTargetPath.Text, fileType, chbAllDirectories.IsChecked);
                    break;

                case FileType.Videos:
                    strMessage = CopyMovies.Copy(txtSrcPath.Text, txtTargetPath.Text, txtFileMoviesList.Text);
                    System.Console.Read();
                    break;

                case FileType.Music:
                    strMessage = ProcessFiles.ExecuteProcessFiles(txtSrcPath.Text, txtTargetPath.Text, fileType, chbAllDirectories.IsChecked);
                    break;

                case FileType.Any:
                    strMessage = ProcessFiles.ExecuteProcessFiles(txtSrcPath.Text, txtTargetPath.Text, fileType, chbAllDirectories.IsChecked);
                    break;

                default:
                    break;
                }

                EditRichTextBox(strMessage, Brushes.Black);
            }
            else
            {
                EditRichTextBox("Something went wrong.", Brushes.Red);
            }
        }
Example #2
0
        public static void Main(string[] args)
        {
            /**********************************************************/

            //CopyMovies.Copy(@"F:\Movies");
            //System.Console.Read();

            /**********************************************************/


            /**********************************************************/

            var srcPath  = @"C:\Users\Leo\Downloads\iloveimg-converted";
            var destPath = @"C:\Users\Leo\Downloads\StagePhotos\";


            ProcessFiles.ExecuteProcessFiles(srcPath, destPath, FileType.Photos, true);
            ProcessFiles.WriteLinesToFiles(srcPath);

            /**********************************************************/

            //Delete Empty Folders
            //ProcessFiles.RemoveEmptyDirectories(srcPath);

            //Renaming Files
            //srcPath = @"F:\Videos\TV Shows\Blue's Clues (Complete)";
            //var collection = new List<KeyValuePair<string, string>>()
            //{
            //    new KeyValuePair<string,string>("Blue's Clues - ",  "BluesClues"),
            //    new KeyValuePair<string,string>( " - ",  ""),
            //    new KeyValuePair<string,string>("'",  ""),
            //    new KeyValuePair<string,string>(" ",  ""),
            //    new KeyValuePair<string,string>("_.",  ".")
            //};
            //foreach (var kv in collection)
            //{
            //    RenameFiles(srcPath, kv.Key, kv.Value);
            //}

            ProcessFiles.WriteLinesToFiles(srcPath);
        }