public static FormulaSpace Read(string FileName) { TextReader reader = new StreamReader(FileName); FormulaSpace space = Read(reader); reader.Close(); return(space); }
public static FormulaSpace Read(TextReader reader) { XmlSerializer serializer = new XmlSerializer(typeof(FormulaSpace)); //string s = reader.ReadToEnd(); // compatible with old version //s = s.Replace("ParamType=\"string\"","ParamType=\"String\"").Replace("ParamType=\"double\"","ParamType=\"Double\""); //MemoryStream ms = new MemoryStream(); FormulaSpace fs = (FormulaSpace)serializer.Deserialize(reader); return(fs); }
public Assembly Compile(string FileName, string ReferenceRoot) { CompilerResults results = FormulaSpace.Compile("using Easychart.Finance;\r\nusing Easychart.Finance.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); }
public Assembly Compile(string FileName, string ReferenceRoot) { CompilerResults cr = FormulaSpace.Compile( "using Easychart.Finance;\r\n" + "using Easychart.Finance.DataProvider;\r\n" + GetSource(""), FileName, ReferenceRoot); StartLineNum = 2; if (cr.Errors.Count > 0) { for (int i = 0; i < cr.Errors.Count; i++) { System.CodeDom.Compiler.CompilerError ce = cr.Errors[i]; AdjustErrors(ce); } throw new FormulaErrorException(null, cr.Errors); } return(cr.CompiledAssembly); }
public FormulaErrorException(FormulaSpace fms, System.CodeDom.Compiler.CompilerErrorCollection ces) { this.fms = fms; this.ces = ces; }
public void Remove(FormulaSpace value) { List.Remove(value); }
public int Add(FormulaSpace value) { return(List.Add(value)); }