public ScripterConfig Load()
        {
            ScripterConfig config = new ScripterConfig();

            config.ScriptDatabaseContext = Convert.ToBoolean(Registry.GetValue(_masterKey, ScriptDatabaseContextKey, config.ScriptDatabaseContext));
            return(config);
        }
        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");
        }
 public void Save(ScripterConfig config)
 {
     Registry.SetValue(_masterKey, ScriptDatabaseContextKey, config.ScriptDatabaseContext);
 }