Beispiel #1
0
        internal CommandConsole(Frontend frontend, IValueConverter valueConverter, IFileSystem fileSystem,
                                IShell shell, ICommandRegistryInternal commandRegistry, ICommandExecutor commandExecutor,
                                ConsoleConfiguration config)
        {
            Current           = this;
            LConsole.Frontend = frontend;

            var history = new History();

            frontend.History = history;

            this.Config          = config ?? new ConsoleConfiguration();
            this.FileSystem      = fileSystem;
            this.CommandRegistry = commandRegistry;
            this.Shell           = shell ?? new Shell(valueConverter, history, fileSystem, new CommandFinder(commandRegistry),
                                                      new Environment(), commandExecutor, null, config);

            frontend.LineInput += Frontend_LineInput;

            Commands.RegisterCommandsIn(this.GetType().Assembly);
            Commands.RegisterCommandsIn(frontend.GetType().Assembly);

            if (config.RegisterAllCommandsOnStartup)
            {
                Commands.RegisterCommandsInAllAssemblies();
            }

            frontend.Init();
        }