Ejemplo n.º 1
0
        protected static void DoWork(RemoveBlackListedFilesOptions options)
        {
            //Start
            options.Directory = StartDefaultAction(options);

            //Do work
            int modifiedFiles = RemovedBlackListedFiles(options);

            //Finish
            var boolRerunWithPerformActions = FinishDefaultAction(options, modifiedFiles);
            if (boolRerunWithPerformActions) { options.PerformActions = true; DoWork(options); }
        }
Ejemplo n.º 2
0
        private static int RemovedBlackListedFiles(RemoveBlackListedFilesOptions options)
        {
            var blackListedFiles = new BlackListConfig(options.ConfigFile).GetBlackListedFiles();

            foreach (var file in blackListedFiles)
            {
                if (!options.PerformActions)
                {
                    Console.WriteLine("Blacklisted file in config: " + file);
                }
            }

            if (!options.PerformActions) Console.WriteLine("Search recursive = " + options.Recursive);
            return RemoveUnwantedFiles(options.Directory, options.Recursive, blackListedFiles, !options.PerformActions);
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            var options = new RemoveBlackListedFilesOptions();
            if (string.IsNullOrEmpty(options.Directory))
                options.Directory = Environment.CurrentDirectory;

            if (Parser.Default.ParseArguments(args, options))
            {
                /*
                options.Directory = _downloadDir;
                options.ConfigFile = Path.Combine(_downloadDir, "RemoveBlackListedFiles.xml");
                options.Recursive = true;
                */

                DoWork(options);
            }
        }