Exemple #1
0
        private void renderTemplate()
        {
            SimpleTemplate t1 = TemplateFactory.GetTemplate <SimpleTemplate>("controller1");

            tp_controller1.Text = args["modelName"] + "Controller";
            src_c1.Text         = t1.Render(args);

            SimpleTemplate t2 = TemplateFactory.GetTemplate <SimpleTemplate>("controller2");

            tp_controller2.Text = args["modelName"] + "QueryController";
            src_c2.Text         = t2.Render(args);

            SimpleTemplate t3 = TemplateFactory.GetTemplate <SimpleTemplate>("service");

            tp_service1.Text = args["modelName"] + "Service";
            src_s1.Text      = t2.Render(args);

            SimpleTemplate t4 = TemplateFactory.GetTemplate <SimpleTemplate>("query");

            tp_service2.Text = args["modelName"] + "Query";
            src_s2.Text      = t2.Render(args);

            LoopTemplate lt = TemplateFactory.GetTemplate <LoopTemplate>("domain");

            tp_domain.Text = args["modelName"] + "";
            src_do.Text    = lt.Render(args);
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            DialogResult result = openFileDialog1.ShowDialog();

            if (result == DialogResult.OK)
            {
                String file = openFileDialog1.FileName;
                textBox1.Text = file;
                SimpleTemplate template          = new SimpleTemplate(file, Encoding.UTF8);
                Dictionary <String, Object> args = new Dictionary <String, Object>();
                args.Add("variname", "ab");
                scintilla1.Text = template.Render(args);
            }
        }