SIL.FieldWorks.Common.Controls.IntChooserBEditControl.IntChooserBEditControl C# (CSharp) Method

IntChooserBEditControl() public method

Initialized with a string like "0:no;1:yes".
public IntChooserBEditControl ( string itemList, int flid ) : System
itemList string The item list.
flid int The flid.
return System
		public IntChooserBEditControl(string itemList, int flid)
		{
			m_flid = flid;
			m_combo = new ComboBox();
			m_combo.DropDownStyle = ComboBoxStyle.DropDownList;
			foreach (string pair in itemList.Split(';'))
			{
				string[] vals = pair.Trim().Split(':');
				if (vals.Length != 2)
					throw new Exception("IntChooserBEditControl values must look like n:name");
				int val = Int32.Parse(vals[0]);
				m_combo.Items.Add(new IntComboItem(vals[1].Trim(), val));
			}
			if (m_combo.Items.Count == 0)
				throw new Exception("IntChooserBEditControl created with zero items");
			m_combo.SelectedIndex = 0;
			m_combo.SelectedIndexChanged +=new EventHandler(m_combo_SelectedIndexChanged);
		}

Same methods

IntChooserBEditControl::IntChooserBEditControl ( string itemList, int flid, int initialIndexToSelect ) : System