Ejemplo n.º 1
0
        public WebServer(string directoryToWatch, string binPath, int?port)
        {
            this.childApp = AppDomain.CreateDomain("MyAppDomain");
            var                assemblyName = Assembly.GetExecutingAssembly().GetName().ToString();
            string             typeName     = typeof(ApplicationRunner).FullName;
            IApplicationRunner runner       = (IApplicationRunner)this.childApp.CreateInstanceAndUnwrap(assemblyName, typeName);

            runner.Run(directoryToWatch, binPath, AppDomain.CurrentDomain.BaseDirectory, port);
//            this.isRunning = true;
        }
        public void Run()
        {
            _applicationRunner.Run();

            Console.WriteLine("\nDone! Press any key to close the window.");
            Console.ReadKey(true);

            if (bool.TryParse(_config["OpenDirectoryOnFinish"], out var openDir) && openDir)
            {
                _directoryService.OpenResultsDirectory();
            }
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            IWindsorContainer container = new WindsorContainer();

            container.Kernel.Resolver.AddSubResolver(new ArrayResolver(container.Kernel));
            container.Register(AllTypes.Pick().FromAssembly(typeof(ApplicationRunner).Assembly)
                               .WithService.FirstInterface());

            IApplicationRunner runner = container.Resolve <IApplicationRunner>();

            runner.Run();

            Console.ReadLine();
        }