Esempio n. 1
0
    protected void SetSelected_(IUIRadioGroupItem target_, bool selected_)
    {
        foreach (IUIRadioGroupItem item_ in items)
        {
            if (item_ == target_)
            {
                _selectedItem = selected_? target_ :null;
                item_.SetSelected(selected_);
            }
        }

        foreach (IUIRadioGroupItem item_ in items)
        {
            if (item_ != target_)
            {
                item_.SetSelected(false);
            }
        }
    }
Esempio n. 2
0
    public void SetupItems(IUIRadioGroupItem[] items_ = null)
    {
        _selectedItem = null;
        if (items_ == null)
        {
            Component[] components_ = GetComponentsInChildren(typeof(IUIRadioGroupItem));
            items = new IUIRadioGroupItem[components_.Length];
            for (int i = 0; i < components_.Length; i++)
            {
                Component component_ = components_[i];
                items[i] = component_ as IUIRadioGroupItem;
            }
        }
        else if (items_ != items)
        {
            items = new IUIRadioGroupItem[items_.Length];
            System.Array.Copy(items_, items, items_.Length);
        }

        foreach (IUIRadioGroupItem item_ in items)
        {
            item_.SetSelected(false);
        }
    }
Esempio n. 3
0
    public int IndexOfItem(IUIRadioGroupItem item_)
    {
        List <IUIRadioGroupItem> list_ = new List <IUIRadioGroupItem>(items);

        return(list_.IndexOf(item_));
    }
Esempio n. 4
0
 public bool IsSelected(IUIRadioGroupItem item_)
 {
     return(IsSelected_(item_));
 }
Esempio n. 5
0
 public void SetSelected(IUIRadioGroupItem item_, bool selected_)
 {
     SetSelected_(item_, selected_);
 }
Esempio n. 6
0
 protected bool IsSelected_(IUIRadioGroupItem target_)
 {
     return((target_ == null)? false :target_ == _selectedItem);
 }