Ejemplo n.º 1
0
 public HelpCommand(ICommandRegistry registry, SystemCommandRegistry systemRegistry, IOutputWriter outputWriter, GeneralSettings settings)
 {
     _registry       = registry;
     _systemRegistry = systemRegistry;
     _outputWriter   = outputWriter;
     _settings       = settings;
 }
Ejemplo n.º 2
0
        public CleeEngine(ICommandRegistry commandRegistry, ICommandFactory commandFactory, 
            IArgumentMapper argumentMapper, ICommandExecutor commandExecutor)
        {
            _registry = commandRegistry;
            _commandFactory = commandFactory;
            _mapper = argumentMapper;
            _commandExecutor = commandExecutor;

            _systemRegistry = SystemCommandRegistry.CreateAndInitialize(); // this should be removed from the constructor!

            _systemCommandFactory = new SystemCommandFactory();
            _systemCommandFactory.RegisterInstance<ICommandRegistry>(_registry);
            _systemCommandFactory.RegisterInstance<ICommandFactory>(_commandFactory);
            _systemCommandFactory.RegisterInstance<IArgumentMapper>(_mapper);
            _systemCommandFactory.RegisterInstance<ICommandExecutor>(_commandExecutor);
            _systemCommandFactory.RegisterInstance<SystemCommandRegistry>(_systemRegistry);
            _systemCommandFactory.RegisterFactoryMethod<IOutputWriter>(() => _outputWriter);
            _systemCommandFactory.RegisterInstance(_settings);

            _history = new LinkedList<HistoryEntry>();
            _outputWriter = new DefaultOutputWriter();
        }
Ejemplo n.º 3
0
 public ListCommand(ICommandRegistry registry, SystemCommandRegistry systemRegistry)
 {
     _registry       = registry;
     _systemRegistry = systemRegistry;
 }