Esempio n. 1
0
        private void CreateCode()
        {
            IList <string> variables;
            IList <string> initializers;
            List <string>  l = new List <string>();

            l.Add(CSharpCodeCreator.StandardHeader);
            l.Add(CSharpCodeCreator.GetGuidClass(new Type[] { typeof(ITreeCollectionProxy) }));
            IList <string> lt = PreCreateCode(out local, out variables, out initializers);

            l.Add("\t\t");
            List <string> ltt = PostCreateCode(local, lt, variables, initializers, "public Calculate", checkValue != null);
            StringBuilder sb  = new StringBuilder();

            foreach (string s in ltt)
            {
                l.Add("\t\t" + s);
            }
            l.Add("");
            l.Add("\t}");
            l.Add("}");
            foreach (string s in l)
            {
                sb.Append(s + Environment.NewLine);
            }
            code = sb + "";
        }
Esempio n. 2
0
        private IList <string> PreCreateCode(out ICodeCreator local,
                                             out IList <string> variables, out IList <string> initializers)
        {
            IList <string> lcode = CSharpCodeCreator.CreateCode(trees, codeCreator,
                                                                out local, out variables, out initializers);

            ObjectFormulaTree[] tr = local.Trees;
            foreach (ObjectFormulaTree tree in tr)
            {
                AddTree(tree, initializers, variables);
            }
            if (checkValue != null)
            {
            }
            return(lcode);
        }