Esempio n. 1
0
        private void SetupContainer(Container container, string[] args)
        {
            var command = args.Length > 0 ? args[0] : "help";

            var configurator = new ContainerConfiguratorFactory(_settings).GetConfigurator(command);

            configurator.SetupContainer(container, _settings, args);
        }
        public void SetupContainer(Container container, ConfigSettings settings, string[] args)
        {
            if (args.Length <= 1)
            {
                container.Register<IStorEvilJob>(new DisplayHelpJob(GetStandardHelpText()));
                return;
            }
            var helpJobFactory = new ContainerConfiguratorFactory(settings).GetConfigurator(args[1]);

            if (helpJobFactory != null)
                container.Register<IStorEvilJob>(
                    new DisplayHelpJob(GetStandardHelpText() + "\r\n\r\nSwitches for '" + args[1] + "': \r\n\r\n" +
                                       helpJobFactory.GetUsage()));
            else
                container.Register<IStorEvilJob>(new DisplayHelpJob(GetStandardHelpText()));
        }