예제 #1
0
파일: Program.cs 프로젝트: emiaj/bottles
        static void Main(string[] args)
        {
            setupLog4Net();

            HostFactory.Run(h =>
            {
                h.SetDescription("Bottle Host");
                h.SetServiceName("bottle-host");
                h.SetDisplayName("display");

                h.Service<BottleHost>(c =>
                {
                    c.ConstructUsing(n =>
                    {
                        var fileSystem = new FileSystem();
                        var packageExploder = new PackageExploder(new ZipFileService(fileSystem),
                                                                  new PackageExploderLogger(ConsoleWriter.Write),
                                                                  fileSystem);
                        return new BottleHost(packageExploder, fileSystem);
                    });
                    c.WhenStarted(s => s.Start());
                    c.WhenStopped(s => s.Stop());
                });
            });
        }
예제 #2
0
파일: Program.cs 프로젝트: jrios/bottles
        static void Main(string[] args)
        {
            File.WriteAllText("pwd.txt", System.Environment.CurrentDirectory);
            log4net.Config.XmlConfigurator.ConfigureAndWatch(new FileInfo("log4net.config"));

            HostFactory.Run(h =>
            {
                h.SetDescription("Bottle Host");
                h.SetServiceName("bottle-host");
                h.SetDisplayName("display");

                h.Service<BottleHost>(c =>
                {
                    c.ConstructUsing(n =>
                    {
                        var fileSystem = new FileSystem();
                        var packageExploder = new PackageExploder(new ZipFileService(fileSystem),
                                                                  new PackageExploderLogger(ConsoleWriter.Write),
                                                                  fileSystem);
                        return new BottleHost(packageExploder, fileSystem);
                    });
                    c.WhenStarted(s => s.Start());
                    c.WhenStopped(s => s.Stop());
                });
            });
        }