Ejemplo n.º 1
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            double value;

            if (!Double.TryParse(textBoxOffset.Text, out value) || value < 0 || value > 100)
            {
                MessageBox.Show("Invalid offset value",
                                "MapManager", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (index >= 0)
            {
                double key = values.Keys[index];
                values.Remove(key);
            }
            else if (values.ContainsKey(value))
            {
                values.Remove(value);
            }

            values.Add(value, colorPickerStopColor.Value);

            DialogResult = DialogResult.OK;
            this.Close();
        }
Ejemplo n.º 2
0
 private void colorPickerStart_ValueChanged(object sender, EventArgs e)
 {
     values.Remove(0);
     values.Add(0, colorPickerStart.Value);
     UpdatePreview();
 }