/// <summary> /// Refreshes the form and removes the selected item /// Also removed the item from the auto change tab drop down /// </summary> private void optionsResolutionRemove_Click(object sender, EventArgs e) { if (optionsResolutionR.SelectedItem.ToString() != optionsAuto1.SelectedItem.ToString()) { if (optionsResolutionR.Items.Count > 1) { using (OptionsResolutionList.Update update = new OptionsResolutionList.Update()) { update.RefreshForm(optionsResolutionR, true); optionsResolutionEdit.Enabled = false; optionsResolutionRemove.Enabled = false; } } else { MessageBox.Show("You must have at least one resolution in your list.", "Unable to remove resolution", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MessageBox.Show("You cannot remove a resolution that you have set for auto change.", "Unable to remove resolution", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
/// <summary> /// Refreshes the form without removing a selected item /// </summary> private void optionsTabs_MouseDown(object sender, MouseEventArgs e) { using (OptionsResolutionList.Update update = new OptionsResolutionList.Update()) { update.RefreshForm(optionsResolutionR, false); optionsResolutionEdit.Enabled = false; optionsResolutionRemove.Enabled = false; } }
/// <summary> /// Splits the selected item up into the exponential value of 2 and the description /// then outputs the two parts into the appropriate textboxes /// </summary> private void optionsResolutionEdit_Click(object sender, EventArgs e) { string[] splitResolution = optionsResolutionR.SelectedItem.ToString().Split('('); optionsResolutionValue.Text = splitResolution[0].TrimEnd(' '); optionsResolutionDefinition.Text = splitResolution[1].TrimEnd(')'); using (OptionsResolutionList.Update update = new OptionsResolutionList.Update()) { update.RefreshForm(optionsResolutionR, true); optionsResolutionEdit.Enabled = false; optionsResolutionRemove.Enabled = false; } optionsResolutionAdd.Text = "Save"; }