/// <summary> /// Handles the Click event of the color change buttons. /// </summary> private void ColorChangeButton_Click(object sender, EventArgs e) { ColorDialog dlg = new ColorDialog(); if (((Button)sender).Name.Contains(DEST_DETECTED)) { dlg.Color = pDestinationDetected.BackColor; if (dlg.ShowDialog(this) == DialogResult.OK) { pDestinationDetected.BackColor = dlg.Color; } } else if (((Button)sender).Name.Contains(DEST_MISSING)) { dlg.Color = pDestinationMissing.BackColor; if (dlg.ShowDialog(this) == DialogResult.OK) { pDestinationMissing.BackColor = dlg.Color; } } else if (((Button)sender).Name.Contains(DEST_CONFLICT)) { dlg.Color = pDestinationConflict.BackColor; if (dlg.ShowDialog(this) == DialogResult.OK) { pDestinationConflict.BackColor = dlg.Color; } } else if (((Button)sender).Name.Contains(MOD_INSTALLED)) { dlg.Color = pModInstalled.BackColor; if (dlg.ShowDialog(this) == DialogResult.OK) { pModInstalled.BackColor = dlg.Color; } } else if (((Button)sender).Name.Contains(MOD_ARCHIVE_MISSING)) { dlg.Color = pModArchiveMissing.BackColor; if (dlg.ShowDialog(this) == DialogResult.OK) { pModArchiveMissing.BackColor = dlg.Color; } } else if (((Button)sender).Name.Contains(MOD_OUTDATED)) { dlg.Color = pModOutdated.BackColor; if (dlg.ShowDialog(this) == DialogResult.OK) { pModOutdated.BackColor = dlg.Color; } } ModSelectionController.InvalidateView(); }
private void ColorTextBoxes_TextChanged(object sender, EventArgs e) { TextBox tb = (TextBox)sender; if (string.IsNullOrEmpty(((TextBox)sender).Text)) { tb.Text = ZERO; } if (tb.Name.Contains(DEST_DETECTED)) { pDestinationDetected.BackColor = Color.FromArgb(255, int.Parse(tbDestinationDetectedRed.Text), int.Parse(tbDestinationDetectedGreen.Text), int.Parse(tbDestinationDetectedBlue.Text)); } else if (tb.Name.Contains(DEST_MISSING)) { pDestinationMissing.BackColor = Color.FromArgb(255, int.Parse(tbDestinationMissingRed.Text), int.Parse(tbDestinationMissingGreen.Text), int.Parse(tbDestinationMissingBlue.Text)); } else if (tb.Name.Contains(DEST_CONFLICT)) { pDestinationConflict.BackColor = Color.FromArgb(255, int.Parse(tbDestinationConflictRed.Text), int.Parse(tbDestinationConflictGreen.Text), int.Parse(tbDestinationConflictBlue.Text)); } else if (tb.Name.Contains(MOD_INSTALLED)) { pModInstalled.BackColor = Color.FromArgb(255, int.Parse(tbModInstalledRed.Text), int.Parse(tbModInstalledGreen.Text), int.Parse(tbModInstalledBlue.Text)); } else if (tb.Name.Contains(MOD_ARCHIVE_MISSING)) { pModArchiveMissing.BackColor = Color.FromArgb(255, int.Parse(tbModArchiveMissingRed.Text), int.Parse(tbModArchiveMissingGreen.Text), int.Parse(tbModArchiveMissingBlue.Text)); } else if (tb.Name.Contains(MOD_OUTDATED)) { pModOutdated.BackColor = Color.FromArgb(255, int.Parse(tbModOutdatedRed.Text), int.Parse(tbModOutdatedGreen.Text), int.Parse(tbModOutdatedBlue.Text)); } ModSelectionController.InvalidateView(); }