Ejemplo n.º 1
0
        public static void Deselect(SelectableButton button)
        {
            button.enabled = true;
            button.SetState(State.Normal, true);

            if (string.IsNullOrEmpty(button.group))
            {
                SelectedButtons[button.group] = null;
            }
        }
Ejemplo n.º 2
0
        public static void SetSelected(SelectableButton button)
        {
            // no group
            if (string.IsNullOrEmpty(button.group))
            {
                button.enabled = false;
                button.SetState(State.Pressed, true);
                return;
            }

            // switch selected
            SelectableButton currentlySelected = SelectedButtons[button.group];
            if (currentlySelected != null)
            {
                currentlySelected.enabled = true;
                currentlySelected.SetState(State.Normal, true);
            }
            button.enabled = false;
            button.SetState(State.Pressed, true);
            SelectedButtons[button.group] = button;
        }