ATMLCommonLibrary.controls.document.DocumentForm.DocumentForm_FormClosing C# (CSharp) Метод

DocumentForm_FormClosing() приватный Метод

private DocumentForm_FormClosing ( object sender, FormClosingEventArgs e ) : void
sender object
e System.Windows.Forms.FormClosingEventArgs
Результат void
        private void DocumentForm_FormClosing( object sender, FormClosingEventArgs e )
        {
            if (documentControl.IsDirty())
            {
                DialogResult result = MessageBox.Show( Resources.Would_you_like_to_save_your_changes, Resources.V_E_R_I_F_Y,
                                                       MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question );
                if (DialogResult.Yes == result)
                {
                    SaveToDatabase();
                }
                else if (DialogResult.Cancel == result)
                {
                    e.Cancel = true;
                }
            }
        }