2 using System.Collections;
3 using System.Collections.Generic;
6 namespace Seci.LabView.Controls
24 public LvRadioButtons(String name, String[] items, SerialisableList<int> indices)
32 _clusterIndices = (Seci.SerialisableList<
int>) indices.Clone();
42 return _name +
" (Radio Buttons)";
47 return "RADIO BUTTONS";
57 public override String[]
GetValue(ref strongnameLabview.VirtualInstrument vi)
61 if (_clusterIndices == null)
63 temp = _items[Convert.ToInt16(vi.GetControlValue(_name))];
67 temp = _items[Convert.ToInt16(GetValueFromCluster(vi)[_clusterIndices[_clusterIndices.Count - 1]])];
70 String[] result = { temp };
83 public override void SetValue(ref strongnameLabview.VirtualInstrument vi, Object value)
88 if (value.GetType() == typeof(Int16))
90 val = Convert.ToInt16(value);
92 else if (value.GetType() == typeof(String))
94 for (
int i = 0; i < _items.GetLength(0); ++i)
96 if (_items[i] == value.ToString())
106 throw new ArgumentException(
"Value sent to radio button was invalid.");
109 if (_clusterIndices == null)
111 vi.SetControlValue(_name, val);
115 SetValueInCluster(ref vi, val);
This class is the abstract base class of the objects used to store the VI control information...