示例#1
0
 public CommandRunnerModel(
     ICommandsCollectionModel commandsCollection,
     ICommandParser commandParser
     )
 {
     this.commandsCollection = commandsCollection;
     this.commandParser      = commandParser;
 }
示例#2
0
 public static IConsoleHintModel Create(
     IConsoleInputHistoryModel history,
     ICommandsCollectionModel commandsCollection,
     IConsoleSettings settings
     )
 {
     return(new ConsoleHintModel(
                commandsCollection,
                history,
                settings
                ));
 }
示例#3
0
 public static ConsoleModel Create(
     IConsoleInputHistoryModel historyModel,
     ICommandsCollectionModel commandsCollection
     )
 {
     return(new ConsoleModel(
                commandsCollection,
                new CommandRunnerModel(
                    commandsCollection,
                    new CommandParserModel(new TypeParserModel())
                    ),
                new ConsoleOutputModel(),
                historyModel
                ));
 }
示例#4
0
    public static void Initialize()
    {
        if (model != null)
        {
            return;
        }

        IConsoleSettings          settings           = ConsoleSettings.Instance;
        IConsoleInputHistoryModel historyModel       = ConsoleInputHistoryModelFactory.Create(settings);
        ICommandsCollectionModel  commandsCollection = CommandsCollectionFactory.Create(settings);

        model = ConsoleModelFactory.Create(historyModel, commandsCollection);

        IConsoleHintModel hintModel = ConsoleHintModelFactory.Create(
            historyModel,
            commandsCollection,
            settings
            );

        ConsoleUIView view = ConsoleUIViewFactory.Create(settings);
        IConsoleInputDetectorModel inputDetector = ConsoleInputDetectorModelFactory.Create(
            view,
            model,
            settings
            );

        ConsoleUIControllerFactory.Create(model, view, inputDetector, hintModel);
        ConsoleHintUIControllerFactory.Create(
            hintModel,
            view.HintUI,
            view,
            inputDetector,
            settings
            );
        Task.Run(commandsCollection.Initialize);
        inputDetector.Initialize();
    }