private void btnApply_Click(Object sender, EventArgs e) { if (isCreatingNewEntry) { if (String.IsNullOrEmpty(txtBoxAddress.Text)) { MessageBox.Show("Address cannot be empty!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (cmbBoxValueType.SelectedIndex < 0) { MessageBox.Show("Value type cannot be empty!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } this.returnInformation = new ReturnInformation { description = txtBoxDescription.Text, address = UInt64.Parse(txtBoxAddress.Text.Replace("0x", ""), System.Globalization.NumberStyles.HexNumber), sectionIndex = Int32.Parse(txtBoxSectionIndex.Text), sectionOffset = UInt32.Parse(txtBoxSectionOffset.Text.Replace("0x", ""), System.Globalization.NumberStyles.HexNumber), valueType = (Type)cmbBoxValueType.SelectedItem, value = txtBoxValue.Text, isAdvanced = chkBoxAdvanced.Checked, isPointer = chkBoxPointer.Checked }; this.DialogResult = DialogResult.OK; this.Close(); }
private void btnApply_Click(Object sender, EventArgs e) { this.returnInformation = new ReturnInformation { description = txtBoxDescription.Text, section = (librpc.MemorySection)cmbBoxSection.SelectedItem, sectionAddressOffset = UInt32.Parse(txtBoxSectionAddressOffset.Text, System.Globalization.NumberStyles.HexNumber), valueType = (String)cmbBoxValueType.SelectedItem, value = txtBoxValue.Text }; this.DialogResult = DialogResult.OK; this.Close(); }