Пример #1
0
        public VirtualEntryLine(IConsole console, IClipboard clipboard, ConsoleFontColor cmdColor)
        {
            console.Requires(nameof(console)).IsNotNull();
            clipboard.Requires(nameof(clipboard)).IsNotNull();

            this._console   = console;
            this._clipboard = clipboard;
            this._cmdColor  = cmdColor;
        }
Пример #2
0
        // NO default public constructor - by design -> use builder
        internal CommandEngine(CommandManager commandManager, ICommandParserOptions options, CommandEngineStyles styles, HelpPrinter printHelper, IConsole console, IClipboard clipboard)
        {
            commandManager.Requires(nameof(commandManager)).IsNotNull();
            options.Requires(nameof(options)).IsNotNull();
            styles.Requires(nameof(styles)).IsNotNull();
            printHelper.Requires(nameof(printHelper)).IsNotNull();
            console.Requires(nameof(console)).IsNotNull();
            clipboard.Requires(nameof(clipboard)).IsNotNull();

            this._commandManager        = commandManager;
            this._autoCompletionManager = new CommandAutoCompletionProvider(this._commandManager);
            this._virtualLine           = new VirtualEntryLine(console, clipboard, styles.Default);
            this._console       = console;
            this._options       = options;
            this._styles        = styles;
            this._helpPrinter   = printHelper;
            this._outputManager = new OutputManager(this._console, this._styles, this._options.UiCulture);

            // TODO: check option before displaying this message
            // this._console.WriteLine(styles.Default, "Initializing ObscureWare's command engine...");
        }