private MainAppContainerBuilder(StartupArguments args)
            : base(args, "NzbDrone.Host", "NzbDrone.Common", "NzbDrone.Core", "NzbDrone.Api", "NzbDrone.SignalR")
        {

            AutoRegisterImplementations<NzbDronePersistentConnection>();

            Container.Register(typeof(IBasicRepository<RootFolder>), typeof(BasicRepository<RootFolder>));
            Container.Register(typeof(IBasicRepository<NamingConfig>), typeof(BasicRepository<NamingConfig>));

            Container.Register<INancyBootstrapper, NancyBootstrapper>();
        }
예제 #2
0
        public static void Main(string[] args)
        {
            try
            {
                var startupArgs = new StartupArguments(args);
                LogTargets.Register(startupArgs, false, true);
                Bootstrap.Start(startupArgs, new ConsoleAlerts());
            }
            catch (TerminateApplicationException)
            {
            }
            catch (Exception e)
            {
                Logger.FatalException("EPIC FAIL!", e);
                System.Console.ReadLine();
            }

            while (true)
            {
                Thread.Sleep(10 * 60);
            }
        }
예제 #3
0
        public static void Main(string[] args)
        {
            try
            {
                var startupArgs = new StartupArguments(args);

                LogTargets.Register(startupArgs, false, true);

                var container = Bootstrap.Start(startupArgs, new MessageBoxUserAlert());
                container.Register<ISystemTrayApp, SystemTrayApp>();
                container.Resolve<ISystemTrayApp>().Start();
            }
            catch (TerminateApplicationException)
            {
            }
            catch (Exception e)
            {
                Logger.FatalException("EPIC FAIL: " + e.Message, e);
                var message = string.Format("{0}: {1}", e.GetType().Name, e.Message);
                MessageBox.Show(text: message, buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Error, caption: "Epic Fail!");
            }
        }
예제 #4
0
        public static IContainer Start(StartupArguments args, IUserAlert userAlert)
        {
            var logger = NzbDroneLogger.GetLogger();

            GlobalExceptionHandlers.Register();
            IgnoreCertErrorPolicy.Register();

            logger.Info("Starting NzbDrone Console. Version {0}", Assembly.GetExecutingAssembly().GetName().Version);


            if (!PlatformValidation.IsValidate(userAlert))
            {
                throw new TerminateApplicationException();
            }

            var container = MainAppContainerBuilder.BuildContainer(args);

            DbFactory.RegisterDatabase(container);
            container.Resolve<Router>().Route();

            return container;
        }
예제 #5
0
        public static void Main(string[] args)
        {
            try
            {
                var startupArgument = new StartupArguments(args);
                LogTargets.Register(startupArgument, true, true);

                Console.WriteLine("Starting NzbDrone Update Client");

                IgnoreCertErrorPolicy.Register();

                GlobalExceptionHandlers.Register();

                _container = UpdateContainerBuilder.Build(startupArgument);

                logger.Info("Updating NzbDrone to version {0}", BuildInfo.Version);
                _container.Resolve<UpdateApp>().Start(args);
            }
            catch (Exception e)
            {
                logger.FatalException("An error has occurred while applying update package.", e);
            }
        }
 public void should_parse_args_with_alues(string arg)
 {
     var args = new StartupArguments(new[] { arg });
     args.Args.Should().HaveCount(1);
     args.Args["key"].Should().Be("value");
 }
 public void should_parse_single_flag(string arg)
 {
     var args = new StartupArguments(new[] { arg });
     args.Flags.Should().HaveCount(1);
     args.Flags.Contains("t").Should().BeTrue();
 }
 public void empty_array_should_return_empty_flags()
 {
     var args = new StartupArguments(new string[0]);
     args.Flags.Should().BeEmpty();
 }
 public static IContainer BuildContainer(StartupArguments args)
 {
     return new MainAppContainerBuilder(args).Container;
 }