public void CleanError(Control control) { ErrorMng_EP.Clear(); Color back_color = ControlTools.Instance.BasicStyle.BackColor; if (control is TextBox) { if (((TextBox)control).ReadOnly) { back_color = ControlTools.Instance.ReadOnlyStyle.BackColor; } } control.BackColor = back_color; }
public override void DoExecuteAction(molAction action) { switch (action) { case molAction.Cancel: if (CancelConfirmation) { if (DialogResult.Yes == ProgressInfoMng.ShowQuestion(Resources.Messages.CANCEL_CONFIRM)) { _action_result = DialogResult.Cancel; CancelAction(); } else { _action_result = DialogResult.Ignore; } } else { _action_result = DialogResult.Cancel; CancelAction(); } break; case molAction.Close: DialogResult = DialogResult.Cancel; Cerrar(); break; case molAction.Print: _action_result = DialogResult.Ignore; PrintAction(); break; case molAction.Save: ErrorMng_EP.Clear(); #if !TRACE PgMng.Reset(3, 1, Face.Resources.Messages.SAVING, this); #endif //Se usa un atributo porque si uso el DialogResult el ShowDialog entiende que quiero cerrar el formulario _action_result = DialogResult.Ignore; SaveAction(); switch (_action_result) { case DialogResult.OK: _action_result = DialogResult.OK; Close(); break; case DialogResult.Cancel: _action_result = DialogResult.Cancel; Close(); break; case DialogResult.Ignore: break; } break; case molAction.ShowDocuments: _action_result = DialogResult.Ignore; DocumentsAction(); break; default: base.DoExecuteAction(action); break; } }