using System;
using System.Windows.Forms;

namespace Demo
{
    using Muban;
    using Muban.Template;

    public partial class frmMain : Form
    {
        public frmMain()
        {
            InitializeComponent();
        }

        private void btnRun_Click(object sender, EventArgs e)
        {
            using (var dlg = new OpenFileDialog() { Filter = "CSHTML or VBHTML|*.cshtml;*.vbhtml" })
            {
                if (dlg.ShowDialog(this) == DialogResult.OK)
                {
                    var path = dlg.FileName;
                    this.txtPath.Text = path;
                    this.txtResult.Text = Parser.Parse<FileTemplate>(path);
                }
            }
        }
    }
}
