private static void LoadControlPrefixInListViewItem(ControlPrefix controlPrefix, ListViewItem listViewItem) { listViewItem.SubItems.Clear(); listViewItem.Text = controlPrefix.Prefix; listViewItem.SubItems.Add(controlPrefix.ControlTypeName); listViewItem.Tag = controlPrefix; }
private void SaveControlPrefixFromControls(ControlPrefix aControlPrefix) { aControlPrefix.Prefix = txtControlPrefixPrefix.Text; aControlPrefix.ControlTypeName = txtControlPrefixTypeName.Text; }
private void btAddComponentPrefix_Click(object sender, System.EventArgs e) { if (ControlPrefixIsValid()) { ListViewItem _ListViewItem = new ListViewItem(); ControlPrefix _ControlPrefix = new ControlPrefix(); SaveControlPrefixFromControls(_ControlPrefix); lvComponentPrefix.Items.Add(_ListViewItem); LoadControlPrefixInListViewItem(_ControlPrefix, _ListViewItem); lvComponentPrefix.SelectedItems.Clear(); _ListViewItem.Selected = true; } LoadControlPrefixInControl(); }