コード例 #1
0
        private void btnSave_Click(object sender, EventArgs ev)
        {
            PgmDialog dialog = new PgmDialog(mainForm, currentPgmName,
                                             this.txtTextArea.Text, PgmDialog.PgmDialogMode.SaveProgram);
            DialogResult result = dialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                currentPgmName   = dialog.ProgramName;
                txtTextArea.Text = dialog.Content;
                SetTitle();
            }
            dialog.Close();
        }
コード例 #2
0
        private void btnOpen_Click(object sender, EventArgs e)
        {
            PgmDialog    dialog = new PgmDialog(mainForm, string.Empty, string.Empty, PgmDialog.PgmDialogMode.OpenProgram);
            DialogResult result = dialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                currentPgmName   = dialog.ProgramName;
                txtTextArea.Text = dialog.Content;
                SetTitle();
            }
            if (result != DialogResult.None)
            {
                dialog.Close();
            }
        }