using System; using System.Collections.Generic; using System.Windows.Forms; namespace Deltares.DSoilModel.Forms { /// /// The ModalListBox class /// public partial class ModalListBox : Form { /// /// Initializes a new instance of the class. /// public ModalListBox() { InitializeComponent(); } /// /// Clears and sets the items. /// /// /// The items. /// public List Items { set { ItemList.Items.Clear(); ItemList.Items.AddRange(value.ToArray()); } } /// /// Gets the selected item. /// /// /// The selected item. /// public String SelectedItem { get { return (ItemList.SelectedItem != null) ? ItemList.SelectedItem.ToString() : null; } } /// /// Handles the DoubleClick event of the ItemList control. /// /// The source of the event. /// The instance containing the event data. private void ItemList_DoubleClick(object sender, EventArgs e) { DialogResult = DialogResult.OK; } } }