Пример #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            UnsavedWarningEventArgs param = new UnsavedWarningEventArgs(Result.Cancel, function);

            UWSC(this, param);
            Hide();
        }
Пример #2
0
        private void OnUnsavedWarningResultEvent(Object sender, UnsavedWarningEventArgs e)
        {
            switch (e.result)
            {
            case Form4.Result.Cancel:
                break;

            case Form4.Result.No:
                if (e.function == Close)
                {
                    saved = true;
                }
                e.function();
                break;

            case Form4.Result.Yes:
                saveToolStripMenuItem_Click(new Object(), new EventArgs());
                e.function();
                break;
            }
            Enabled = true;
        }