/// <summary> /// Кнопка Ok. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnOk_Click(object sender, EventArgs e) { if (ErrorIfNullExists()) { return; } bool Result = false; if (operation != Operation.Del) { SetFeature(); } if (operation == Operation.Del) { Result = OperationDelete(); } if (operation == Operation.Add) { Result = Obj.Write(); } if (operation == Operation.AddChild) { Result = Obj.Write(); } if (operation == Operation.Edit) { Result = Obj.Write(); } if (Result) { DialogResult = DialogResult.OK; StatusClose = 1; } else { DialogResult = DialogResult.Cancel; StatusClose = 2; } Close(); }
private void btnOk_Click(object sender, EventArgs e) { if (ErrorIfNullExists()) { return; } if (tbTypeStr.Text != "") { Obj["Main1.Type"] = (tbTypeStr.SelectedIndex + 1).ToString(); } bool Result = false; if (operation == Operation.Del) { Result = OperationDelete(); } if (operation == Operation.Add) { Result = Obj.Write(); } if (operation == Operation.Edit) { Result = Obj.Write(); } if (Result) { DialogResult = DialogResult.OK; StatusClose = 1; } else { DialogResult = DialogResult.Cancel; StatusClose = 2; } Close(); }