Esempio n. 1
0
        private static void Main(string[] args)
        {
            var parameters = DefaultParser.ParseOrExitWithUsageMessage <Parameters>(args);

            Log.Logger = new LoggerConfiguration()
                         .WriteTo.LiterateConsole()
                         .MinimumLevel.Is(parameters.LogLevel)
                         .MinimumLevel.Verbose()
                         .CreateLogger();

            var currentDirectory = new DirectoryInfo(parameters.Directory);

            var bindingRedirector = new BindingRedirector(Log.Logger, new RecursingDirectoryScanner(), new CsprojReferenceScanner(), new AssemblyReferenceConsolidator());

            bindingRedirector.AddBindingRedirects(currentDirectory);
        }
Esempio n. 2
0
        private static void Main(string[] args)
        {
            try
            {
                Console.WriteLine("--------------------------------------------------------------------------------");
                Console.WriteLine("       W A R N I N G              W A R N I NG              W A R N I N G       ");
                Console.WriteLine("--------------------------------------------------------------------------------");
                Console.WriteLine(" THIS IS A HIGHLY PERSONALISED PROGRAM THAT WILL MOVE AND DELETE FILES!         ");
                Console.WriteLine(" DO NOT CONTINUE UNLESS YOU HAVE READ AND UNDERSTOOD THE CODE AND ARE WILLING   ");
                Console.WriteLine(" TO RISK LOSING YOUR FILES.                                                     ");
                Console.WriteLine();
                Console.WriteLine("-------------------------------------------------------------------------------");
                Console.Write("DO YOU WISH TO CONTINUE [Y/N]: ");
                var confirmationChar = Console.ReadKey().KeyChar;
                Console.WriteLine();
                if (confirmationChar != 'y' && confirmationChar != 'Y')
                {
                    Console.WriteLine("Exiting without doing anything.");
                    return;
                }


                var configuration = DefaultParser.ParseOrExitWithUsageMessage <CommandLineParameters>(args);

                configuration.Source      = PromptForFolder("Source", configuration.Source);
                configuration.Destination = PromptForFolder("Destination", configuration.Destination);

                new PhotoImporter(configuration).Import();
            }
            catch (Exception e)
            {
                Console.WriteLine($"Failed with error: {e.Message}");
            }
            finally
            {
#if DEBUG
                Console.Write("Press any key to exit...");
                Console.ReadKey();
#endif
            }
        }
Esempio n. 3
0
        public static void Main(string[] args)
        {
            var options = DefaultParser.ParseOrExitWithUsageMessage <MyCommandLineParameters>(args);

            new Greeter(options).SayHelloToTheNicePerson();
        }
Esempio n. 4
0
        private static void Main(string[] args)
        {
            var configuration = DefaultParser.ParseOrExitWithUsageMessage <CommandLineParameters>(args);

            new Greeter(configuration).SayHello();
        }