Пример #1
0
        private void mniOpen_Click(object sender, EventArgs e)
        {
            if (FEmrView.ReadOnly)
            {
                MessageBox.Show("当前文档只读!");
                return;
            }

            OpenFileDialog vOpenDlg = new OpenFileDialog();

            vOpenDlg.Filter = "支持的文件|*" + HC.View.HC.HC_EXT + "; *.xml|HCView (*.hcf)|*" + HC.View.HC.HC_EXT + "|HCView xml (*.xml)|*.xml";
            if (vOpenDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if (vOpenDlg.FileName != "")
                {
                    Application.DoEvents();
                    string vExt = System.IO.Path.GetExtension(vOpenDlg.FileName);
                    if (vExt == HC.View.HC.HC_EXT)
                    {
                        FEmrView.LoadFromFile(vOpenDlg.FileName);
                    }
                    else
                    if (vExt == ".xml")
                    {
                        FEmrView.LoadFromXml(vOpenDlg.FileName);
                    }
                }
            }
        }