예제 #1
0
 internal ITemplate GetTemplate(string templateText, IDictionary <string, object?> variableTemplate, string templateName, string?templatePath)
 {
     Settings.IsReadOnly = true;
     return(Settings.DynamicTemplates ?
            (ITemplate)DynamicTemplate.LoadTemplate(this, templateText, templateName, templatePath) :
            CompiledTemplate.LoadTemplate(this, templateText, variableTemplate, templateName, templatePath));
 }
예제 #2
0
 internal DynamicTemplate GetDynamicTemplate(string templateText, string?templateName, string?templatePath)
 {
     Settings.IsReadOnly = true;
     if (Settings.DynamicTemplates == false)
     {
         throw new NotImplementedException();
     }
     return(DynamicTemplate.LoadTemplate(this, templateText, templateName, templatePath));
 }
예제 #3
0
 public void start(DynamicTemplate template, Message message, IVkApi api)
 {
     timer           = new Timer(1000);
     timer.AutoReset = true;
     timer.Elapsed  += OnElapsed;
     this.template   = template;
     this.api        = api;
     peerId          = message.PeerId.Value;
     messageId       = message.Id.Value;
     timer.Start();
 }
예제 #4
0
        private void Run(List <TableDefinition> tables, DynamicTemplate template)
        {
            Commands = TemplateParser.Parse(template);
            foreach (TableDefinition table in tables)
            {
                SetGlobalVariable("TableName", "string", table.TableName);

                CodeFile = CodeFileFactory.Create(template.FileType);

                foreach (CommandBase command in Commands)
                {
                    command.Execute();
                }
            }
        }
예제 #5
0
        private static void Main(string[] args)
        {
            //DatabaseDataSourceStrategy databaseDataSourceStrategy = new DatabaseDataSourceStrategy();
            //((DataSourceStrategyBase)databaseDataSourceStrategy).Settings = "Server=RHALE78-5-1102;Database=ExpressRecipe.Logging;Trusted_Connection=True;";
            //databaseDataSourceStrategy.GetAllTables();

            DynamicTemplate template = new DynamicTemplate();

            template.LoadSingleLine("this is a test");
            template.LoadSingleLine("!@this is a test@!");
            template.LoadSingleLine("!@this@! is a test");
            template.LoadSingleLine("!@this@! is a !@test@!");
            template.LoadSingleLine("@!this@! is !@a !@test");
            template.LoadSingleLine("!@this!@ is @!a @!test");

            CommandInterpreter interpreter = new CommandInterpreter();

            interpreter.SetVariable("test", "string", "test123");
            interpreter.SetVariable("test", "123");
            dynamic tmp = interpreter.GetVariableValue("test");
            int     a   = 0;
        }
 public DynamicTemplateDescriptor(IConnectionSettingsValues connectionSettings)
 {
     this._Template           = new DynamicTemplate();
     this._connectionSettings = connectionSettings;
 }