Beispiel #1
0
        /// <summary>
        /// Confirm the grouping based on the arguments passed.
        /// </summary>
        /// <param name="files"></param>
        /// <param name="arguments"></param>
        /// <returns></returns>
        private async Task <bool> ConfirmPrompt(IPhotoCollection files, Arguments arguments)
        {
            await ListFiles(files, arguments);

            Console.WriteLine("Confirm moving {0} files?"
                              , files.Count());

            Console.Write("[Y] Yes (default), [N] No: ");

            string key = Console.ReadLine();

            return(key.StartsWith("Y") || key.StartsWith("y"));
        }
Beispiel #2
0
        /// <summary>
        /// Confirm the grouping based on the arguments passed.
        /// </summary>
        /// <param name="files"></param>
        /// <param name="arguments"></param>
        /// <returns></returns>
        private async Task <IPhotoCollection> HandleConfirm(IPhotoCollection files, Arguments arguments)
        {
            IProgress <int> updateProgress = new Progress <int>(percentage =>
            {
                Console.Write("\rProgress: {0}%", percentage);
            });

            int fileCount = files.Count();

            if (!arguments.ConfirmPrompt || await ConfirmPrompt(files, arguments))
            {
                Console.Write("Progress: 0%");

                files = await files.Confirm(updateProgress);

                Console.WriteLine("\nSuccessfully moved {0} files.", fileCount);
            }

            return(files);
        }