public ATMLSelectionCheckListForm(ATMLSelectionCheckListContext context) { InitializeComponent(); this.context = context; lblSelectionLabel.Text = context.SelectionLabelText; cmbSelect.DataSource = context.SelectionData; cmbSelect.SelectedIndexChanged += cmbSelect_SelectedIndexChanged; lvCheckList.CheckBoxes = true; Type type = Type.GetType(context.ListItemClassName); foreach (PropertyInfo pi in type.GetProperties()) { if (pi.PropertyType.Name.Equals("String")) { lvCheckList.Columns.Add(pi.Name); columnNames.Add(pi.Name); } } if (columnNames.Count > 0) { int width = lvCheckList.Width/columnNames.Count; for (int i = 0; i < columnNames.Count; i++) lvCheckList.Columns[i].Width = width; } }
public ATMLSelectionCheckListForm(ATMLSelectionCheckListContext context) { InitializeComponent(); this.context = context; lblSelectionLabel.Text = context.SelectionLabelText; cmbSelect.DataSource = context.SelectionData; cmbSelect.SelectedIndexChanged += cmbSelect_SelectedIndexChanged; lvCheckList.CheckBoxes = true; Type type = Type.GetType(context.ListItemClassName); foreach (PropertyInfo pi in type.GetProperties()) { if (pi.PropertyType.Name.Equals("String")) { lvCheckList.Columns.Add(pi.Name); columnNames.Add(pi.Name); } } if (columnNames.Count > 0) { int width = lvCheckList.Width / columnNames.Count; for (int i = 0; i < columnNames.Count; i++) { lvCheckList.Columns[i].Width = width; } } }
private void btnSelect_Click(object sender, EventArgs e) { var context = new ATMLSelectionCheckListContext(); context.SelectionLabelText = "Connector"; context.SelectionData = _connectors.Connector; context.SelectionListClassName = "Pins"; context.ListItemClassName = "ATMLModelLibrary.model.common.ConnectorPin"; var form = new ATMLSelectionCheckListForm(context); if (DialogResult.OK == form.ShowDialog()) { } }