//预览模板
 private void btnPreview_Click(object sender, EventArgs e)
 {
     if (cbTemplate.SelectedItem == null) return;
     string fileName = Path.Combine(templatePath, cbTemplate.SelectedItem.ToString());
     PreviewFile pf = new PreviewFile(fileName, CodeType.CSHARP);
     pf.ShowDialog();
 }
        //预览模板
        private void btnPreview_Click(object sender, EventArgs e)
        {
            if (cbTemplate.SelectedItem == null)
            {
                return;
            }
            string      fileName = Path.Combine(templatePath, cbTemplate.SelectedItem.ToString());
            PreviewFile pf       = new PreviewFile(fileName, CodeType.CSHARP);

            pf.ShowDialog();
        }
        //预览模板
        private void btnPreview_Click(object sender, EventArgs e)
        {
            string fileName = txtTemplateFile.Text;

            if (File.Exists(fileName))
            {
                PreviewFile pf = new PreviewFile(fileName, CodeType.CSHARP);
                pf.ShowDialog();
            }
            else
            {
                MessageBox.Show(string.Format("文件[{0}]不存在", fileName));
            }
        }
        //预览模板
        private void btnPreview_Click(object sender, EventArgs e)
        {
            string fileName = txtTemplateFile.Text;

            if (File.Exists(fileName))
            {
                PreviewFile pf = new PreviewFile(fileName, CodeType.CSHARP);
                pf.ShowDialog();
            }
            else
            {
                MessageBox.Show(string.Format("文件[{0}]不存在",fileName));
            }
        }