예제 #1
0
        private void mniSaveAs_Click(object sender, EventArgs e)
        {
            SaveFileDialog vDlg = new SaveFileDialog();

            vDlg.Filter = "文件|*" + HC.View.HC.HC_EXT + "|HCView xml|*.xml" + "|pdf文件|*.pdf" + "|html页面|*.html";
            if (vDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if (vDlg.FileName != "")
                {
                    string vExt = "";
                    switch (vDlg.FilterIndex)
                    {
                    case 1:
                        vExt = HC.View.HC.HC_EXT;
                        break;

                    case 2:
                        vExt = ".xml";
                        break;

                    case 3:
                        vExt = ".pdf";
                        break;

                    case 4:
                        vExt = ".html";
                        break;

                    default:
                        return;
                    }

                    if (System.IO.Path.GetExtension(vDlg.FileName) != vExt)
                    {
                        vDlg.FileName = vDlg.FileName + vExt;
                    }

                    switch (vDlg.FilterIndex)
                    {
                    case 1:
                        FEmrView.SaveToFile(vDlg.FileName);
                        break;

                    case 2:
                        FEmrView.SaveToXml(vDlg.FileName, Encoding.UTF8);
                        break;

                    case 3:
                        FEmrView.SaveToPDF(vDlg.FileName);
                        break;

                    case 4:
                        FEmrView.SaveToHtml(vDlg.FileName);
                        break;
                    }
                }
            }
        }