/*
* Copyright(c) 2019 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System.ComponentModel;
namespace Tizen.NUI.Components
{
///
/// The RadioButtonGroup class is used to group together a set of RadioButton control
/// It enables the user to select exclusively single radio button of group.
///
///
/// RadioButtonGroup radioGroup = new RadioButtonGroup();
/// RadioButton radio1 = new RadioButton();
/// RadioButton radio2 = new RadioButton();
/// radioGroup.Add(radio1);
/// radioGroup.Add(radio2);
///
/// 6
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public class RadioButtonGroup : SelectGroup
{
///
/// Construct RadioButtonGroup
///
/// 6
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public RadioButtonGroup() : base()
{
EnableMultiSelection = false;
}
///
/// Get the RadioButton object at the specified index.
///
/// item index
/// RadioButton
/// 6
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public RadioButton GetItem(int index)
{
return ItemGroup[index] as RadioButton;
}
///
/// Add RadioButton to the end of RadioButtonGroup.
///
/// The RadioButton to be added to the RadioButtonGroup
/// 6
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public void Add(RadioButton radio)
{
if (null == radio) return;
base.AddSelection(radio);
radio.ItemGroup = this;
}
///
/// Remove RadioButton from the RadioButtonGroup.
///
/// The RadioButton to remove from the RadioButtonGroup
/// 6
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public void Remove(RadioButton radio)
{
if (null == radio) return;
base.RemoveSelection(radio);
radio.ItemGroup = null;
}
}
}