Beispiel #1
0
        public Schema(Configuration source,  IEnumerable<string> includePaths = null, bool runScript = true, ScriptRunner runner = null)
        {
            m_SourceOriginal = source;
                m_IncludePaths = includePaths ?? Enumerable.Empty<string>();

                processIncludes(source.Root, new HashSet<string>());

                if (runScript)
                {
                    m_SourceScriptRunner = runner ?? new ScriptRunner();

                    m_Source = new MemoryConfiguration();

                    m_SourceScriptRunner.Execute(m_SourceOriginal, m_Source);
                }
                else
                    m_Source = m_SourceOriginal;
        }
Beispiel #2
0
 public Schema(string fileName,  IEnumerable<string> includePaths = null, bool runScript = true, ScriptRunner runner = null)
     : this(Configuration.ProviderLoadFromFile(fileName), includePaths, runScript, runner)
 {
 }
Beispiel #3
0
 private void btnScripting_Click(object sender, EventArgs e)
 {
     try
     {
         var src = LaconicConfiguration.CreateFromString(this.sourceScripting.Text);
         var res = new LaconicConfiguration();
         var runner = new ScriptRunner();
         runner.TimeoutMs = 500; // for slow computers may be increased
         runner.Execute(src, res);
         this.resultScripting.Text = res.SaveToString();
     }
     catch (Exception ex)
     {
         this.resultScripting.Text = ex.ToMessageWithType();
     }
 }