Exemple #1
0
 public FormulaProgram GetProgramByLineNum(int Line)
 {
     if (this.Namespaces != null)
     {
         foreach (FormulaSpace space in this.Namespaces)
         {
             FormulaProgram programByLineNum = space.GetProgramByLineNum(Line);
             if (programByLineNum != null)
             {
                 return(programByLineNum);
             }
         }
     }
     if (this.Programs != null)
     {
         foreach (FormulaProgram program2 in this.Programs)
         {
             if (program2.InProgram(Line))
             {
                 return(program2);
             }
         }
     }
     return(null);
 }
Exemple #2
0
 public FormulaProgram FindFormulaProgram(string Path, FormulaBase fb)
 {
     if (Path == "")
     {
         Path = this.Name;
     }
     else if (!this.GroupOnly)
     {
         Path = Path + "." + this.Name;
     }
     foreach (FormulaProgram program in this.Programs)
     {
         if (string.Compare(Path + "." + program.Name, fb.GetType().ToString(), true) == 0)
         {
             return(program);
         }
     }
     foreach (FormulaSpace space in this.Namespaces)
     {
         FormulaProgram program2 = space.FindFormulaProgram(Path, fb);
         if (program2 != null)
         {
             return(program2);
         }
     }
     return(null);
 }
Exemple #3
0
        public FormulaProgram FindFormulaProgram(string Path, FormulaBase fb)
        {
            if (Path == "")
            {
                Path = Name;
            }
            else
            {
                if (!GroupOnly)
                {
                    Path += "." + Name;
                }
            }

            foreach (FormulaProgram fp in Programs)
            {
                if (string.Compare(Path + "." + fp.Name, fb.GetType().ToString(), true) == 0)
                {
                    return(fp);
                }
            }

            foreach (FormulaSpace fs in Namespaces)
            {
                FormulaProgram fp = fs.FindFormulaProgram(Path, fb);
                if (fp != null)
                {
                    return(fp);
                }
            }
            return(null);
        }
Exemple #4
0
 public FormulaProgram GetProgramByLineNum(int Line)
 {
     if (Namespaces != null)
     {
         foreach (FormulaSpace fs in Namespaces)
         {
             FormulaProgram fp = fs.GetProgramByLineNum(Line);
             if (fp != null)
             {
                 return(fp);
             }
         }
     }
     if (Programs != null)
     {
         foreach (FormulaProgram p in Programs)
         {
             if (p.InProgram(Line))
             {
                 return(p);
             }
         }
     }
     return(null);
 }
Exemple #5
0
        public string ToHtml()
        {
            string s = "<font color=red>";

            foreach (System.CodeDom.Compiler.CompilerError ce in ces)
            {
                if (fms != null)
                {
                    FormulaProgram fpa = fms.GetProgramByLineNum(ce.Line);
                    if (fpa != null)
                    {
                        fpa.AdjustErrors(ce);
                        s += string.Format("Name:{0} line:{1} column:{2} error:{3} {4}<br>", fpa.Name, ce.Line, ce.Column, ce.ErrorNumber, ce.ErrorText);
                    }
                }
            }
            return(s + "</font>");
        }
 public int Add(FormulaProgram value)
 {
     return(base.List.Add(value));
 }
 public void Remove(FormulaProgram value)
 {
     base.List.Remove(value);
 }