Exemple #1
0
 public New3Command(string commandName, ITemplateEngineHost host, Action <IEngineEnvironmentSettings, IInstaller> onFirstRun, ExtendedCommandParser app, CommandArgument templateName)
 {
     host = new ExtendedTemplateEngineHost(host, this);
     EnvironmentSettings = new EngineEnvironmentSettings(host, x => new SettingsLoader(x));
     Installer           = new Installer(EnvironmentSettings);
     _templateCreator    = new TemplateCreator(EnvironmentSettings);
     _templateCache      = new TemplateCache(EnvironmentSettings);
     _aliasRegistry      = new AliasRegistry(EnvironmentSettings);
     CommandName         = commandName;
     _paths = new Paths(EnvironmentSettings);
     _app   = app;
     _templateNameArgument = templateName;
     _onFirstRun           = onFirstRun;
 }
Exemple #2
0
        public New3Command(string commandName, ITemplateEngineHost host, ITelemetryLogger telemetryLogger, Action <IEngineEnvironmentSettings, IInstaller> onFirstRun, INewCommandInput commandInput, string hivePath)
        {
            _telemetryLogger    = telemetryLogger;
            host                = new ExtendedTemplateEngineHost(host, this);
            EnvironmentSettings = new EngineEnvironmentSettings(host, x => new SettingsLoader(x), hivePath);
            _settingsLoader     = (SettingsLoader)EnvironmentSettings.SettingsLoader;
            Installer           = new Installer(EnvironmentSettings);
            _templateCreator    = new TemplateCreator(EnvironmentSettings);
            _aliasRegistry      = new AliasRegistry(EnvironmentSettings);
            CommandName         = commandName;
            _paths              = new Paths(EnvironmentSettings);
            _onFirstRun         = onFirstRun;
            _hostDataLoader     = new HostSpecificDataLoader(EnvironmentSettings.SettingsLoader);
            _commandInput       = commandInput;

            if (!EnvironmentSettings.Host.TryGetHostParamDefault("prefs:language", out _defaultLanguage))
            {
                _defaultLanguage = null;
            }
        }
Exemple #3
0
        internal New3Command(string commandName, ITemplateEngineHost host, ITelemetryLogger telemetryLogger, New3Callbacks callbacks, INewCommandInput commandInput, string?hivePath, bool virtualize = false)
        {
            _telemetryLogger    = telemetryLogger;
            host                = new ExtendedTemplateEngineHost(host, this);
            EnvironmentSettings = new EngineEnvironmentSettings(host, settingsLocation: hivePath, onFirstRun: FirstRun, virtualizeSettings: virtualize);
            _settingsLoader     = EnvironmentSettings.SettingsLoader;
            _templateCreator    = new TemplateCreator(EnvironmentSettings);
            _aliasRegistry      = new AliasRegistry(EnvironmentSettings);
            CommandName         = commandName;
            _hostDataLoader     = new HostSpecificDataLoader(EnvironmentSettings.SettingsLoader);
            _commandInput       = commandInput;
            _callbacks          = callbacks;
            if (callbacks == null)
            {
                callbacks = new New3Callbacks();
            }

            if (!EnvironmentSettings.Host.TryGetHostParamDefault("prefs:language", out _defaultLanguage))
            {
                _defaultLanguage = null;
            }
        }