Exemplo n.º 1
0
        private void button_OK_Click(object sender, EventArgs e)
        {
            if (this.textBox_exportFileName.Text == "")
            {
                MessageBox.Show(this, "尚未指定输出文件名");
                return;
            }

            string             strError  = "";
            TemplateCollection templates = null;

            this.Cursor = Cursors.WaitCursor;
            int nRet = BuildTemplates(out templates,
                                      out strError);

            this.Cursor = Cursors.Arrow;
            if (nRet == -1)
            {
                goto ERROR1;
            }

            try
            {
                templates.Save(this.textBox_exportFileName.Text);
            }
            catch (Exception ex)
            {
                strError = ExceptionUtil.GetAutoText(ex);
                goto ERROR1;
            }

            this.DialogResult = DialogResult.OK;
            this.Close();
            return;

ERROR1:
            MessageBox.Show(this, strError);
        }