コード例 #1
0
        public string Execute()
        {
            ScripterParserInput parserInput = null;

            if (!TryGetParserInput(out parserInput))
            {
                return("Cannot find any input");
            }

            ScripterParserResult parserResult = null;

            if (!_parser.TryParse(parserInput, out parserResult))
            {
                return(parserResult.Error);
            }

            ScripterConfig config = _configStorage.Load();

            var scripterInput = new ScripterInput()
            {
                Database = parserResult.Database,
                Schema   = parserResult.Schema,
                Name     = parserResult.Name,
                ScriptDatabaseContext = config.ScriptDatabaseContext,
            };

            string scriptResult = null;

            if (!TryScript(scripterInput, out scriptResult))
            {
                return(scriptResult);
            }

            IEditor editor = _hostCtx.GetNewEditor();

            editor.SetContent(scriptResult);

            return("Success");
        }