Esempio n. 1
0
        static void Main(string[] args)
        {
            ContainerBuilder builder = new ContainerBuilder();

            ConfigureContainer(builder);

            IContainer        container        = builder.Build();
            IFileSystemHelper fileSystemHelper = container.Resolve <IFileSystemHelper>();

            ILogger <Program> logger = container.Resolve <ILogger <Program> >();

            Console.WriteLine("**********************************************************");
            Console.WriteLine("*   Vhd Native Boot Os Migrator by Przemysław Łukawski   *");
            Console.WriteLine("**********************************************************");
            logger.LogDebug("Vhd Native Boot Os Migrator has started.");

            DisplayUsage();
            ParseArguments(args);

            MigrationFlowData migrationData = BuildMigrationData(operationMode, fileSystemHelper, addToBootManager);

            DisplaySummary(migrationData, logger);

            if (!quiet)
            {
                Console.Write("Are the above information ok (Y/N)?");
                ConsoleKeyInfo answer = Console.ReadKey();
                if (answer.Key != ConsoleKey.Y)
                {
                    return;
                }
                Console.WriteLine();
            }

            container.Dispose();
            builder = new ContainerBuilder();
            ConfigureContainer(builder);
            builder.RegisterInstance(migrationData); //register migrationDate
            container = builder.Build();             //rebuild container to contain migrationData
            DependencyResolverAccessor.Container = container;


            MigratorEngine engine = container.Resolve <MigratorEngine>();

            string[] messages;
            bool     checkResult = engine.CheckPrerequisities(out messages);

            if (checkResult)
            {
                engine.PerformMigration();
            }
            else
            {
                Console.WriteLine("Cannot continue because of the following checks failed:");
                foreach (string message in messages)
                {
                    Console.WriteLine(message);
                }
            }

            if (!quiet)
            {
                Console.WriteLine("Press any key to exit.");
                Console.ReadKey();
            }
        }
Esempio n. 2
0
 public void TestFixtureSetUp()
 {
     _migEngine = new MigratorEngine();
 }
Esempio n. 3
0
        static int Main(string[] args)
        {
            var me = new MigratorEngine();

            return(me.Main(args));
        }