Exemple #1
0
        // This method is invoked whenever the player clicks the right most button of this user control class instance.
        private void m_ButtonPin4_Click(object sender, EventArgs e)
        {
            if (sr_ColorPicker.ShowDialog(/*r_eColors*/) == DialogResult.OK)
            {
                int index = Array.IndexOf(r_eColors, sr_ColorPicker.NameOfPickedColor);
                if (index == -1)
                {
                    m_ButtonPin4.BackColor = sr_ColorPicker.ActualPickedColor;
                }
                else
                {
                    Algorithm <ColorPicker.eColor> .Swap(ref r_eColors[3], ref r_eColors[index]);

                    Color temporary = pinButtons[3].BackColor;
                    pinButtons[3].BackColor     = pinButtons[index].BackColor;
                    pinButtons[index].BackColor = temporary;
                }

                r_eColors[3]          = sr_ColorPicker.NameOfPickedColor;
                m_ButtonArrow.Enabled = Enumerable <ColorPicker.eColor> .AllHasValue(r_eColors);
            }
        }