예제 #1
0
 public void AddRadioButton(RadioButtonView radioButton)
 {
     if (_buttons.Contains(radioButton))
     {
         return;
     }
     _buttons.Add(radioButton);
     radioButton.RadioGroup = this;
 }
예제 #2
0
 public void Select(RadioButtonView radioButton)
 {
     if (!_buttons.Contains(radioButton))
     {
         return;
     }
     if (radioButton.StateOn)
     {
         return;
     }
     foreach (var radioButtonView in _buttons)
     {
         if (radioButtonView == radioButton)
         {
             continue;
         }
         radioButtonView.StateOn = false;
     }
     radioButton.StateOn = true;
 }
예제 #3
0
 public void Notify(RadioButtonView radioButton)
 {
     if (!_buttons.Contains(radioButton))
     {
         return;
     }
     foreach (var radioButtonView in _buttons)
     {
         if (radioButtonView == radioButton)
         {
             if (!radioButton.StateOn)
             {
                 radioButton.StateOn = true;
             }
         }
         else
         {
             radioButtonView.StateOn = false;
         }
     }
 }
예제 #4
0
 public void RemoveRadioButton(RadioButtonView radioButton)
 {
     _buttons.Remove(radioButton);
     radioButton.RadioGroup = null;
 }