private void headerControl_ReloadRised(object sender, EventArgs e) { //Lifelength l = currentDirective.NextPerformance; //l = currentDirective.SinceEffectivityDateLifelength; if (generalDataAndPerformanceControl.GetChangeStatus(true) || attributesAndParametersControl.GetChangeStatus(true)) { if (MessageBox.Show("All unsaved data will be lost. Are you sure you want to continue?", (string)new TermsProvider()["SystemName"], MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { UpdateDirective(); } } else { UpdateDirective(); } }
/// <summary> /// Вызывается событие удаления отображаемого объекта /// </summary> /// <param name="arguments"></param> public void OnDisplayerRemoving(DisplayerCancelEventArgs arguments) { if (generalDataAndPerformanceControl.GetChangeStatus(false) || attributesAndParametersControl.GetChangeStatus(false)) { switch (MessageBox.Show("Do you want to save changes?", (string)new TermsProvider()["SystemName"], MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1)) { case DialogResult.Yes: if (!AddNewDirective(false)) { arguments.Cancel = true; } break; case DialogResult.Cancel: arguments.Cancel = true; break; } } }