Exemple #1
0
        public static FormulaSpace Read(string FileName)
        {
            TextReader   reader = new StreamReader(FileName);
            FormulaSpace space  = Read(reader);

            reader.Close();
            return(space);
        }
        public Assembly Compile(string FileName, string ReferenceRoot)
        {
            CompilerResults results = FormulaSpace.Compile("using NB.StockStudio.Foundation;\r\nusing NB.StockStudio.Foundation.DataProvider;\r\n" + this.GetSource(""), FileName, ReferenceRoot);

            this.StartLineNum = 2;
            if (results.Errors.Count > 0)
            {
                for (int i = 0; i < results.Errors.Count; i++)
                {
                    CompilerError ce = results.Errors[i];
                    this.AdjustErrors(ce);
                }
                throw new FormulaErrorException(results.Errors);
            }
            return(results.CompiledAssembly);
        }
 private static FormulaProgram GetFormulaProgram(string Filename, FormulaBase fb)
 {
     if (Filename != null)
     {
         FormulaSpace space = (FormulaSpace)htFormulaSpace[Filename];
         if ((space == null) && System.IO.File.Exists(Filename))
         {
             space = FormulaSpace.Read(Filename);
             htFormulaSpace[Filename] = space;
         }
         if (space != null)
         {
             return(space.FindFormulaProgram(fb));
         }
     }
     return(null);
 }
Exemple #4
0
 public int Add(FormulaSpace value)
 {
     return(base.List.Add(value));
 }
Exemple #5
0
 public void Remove(FormulaSpace value)
 {
     base.List.Remove(value);
 }