private void UpdateDependence(int n) { fItemSelect ItemSelect = new fItemSelect(); DialogResult R = ItemSelect.ShowDialog(); if (R == DialogResult.OK) { List <int> Returned = fItemSelect.ReturnItems; if (Returned.Count == 0) { return; } ; for (int i = 0; i < Returned.Count; i++) { if (!ItemList[n].Dependence.Contains(Returned[i])) { ItemList[n].Dependence.Add(Returned[i]); } ; } ; FillDependence(n); } ; }
private void UpdateConditional(int n, int?conditionalIndex = null) { List <int> selectedItems = null; if (conditionalIndex.HasValue) { selectedItems = ItemList[n].Conditional[conditionalIndex.Value]; } fItemSelect ItemSelect = new fItemSelect(selectedItems); DialogResult R = ItemSelect.ShowDialog(); if (R == DialogResult.OK) { List <int> Returned = fItemSelect.ReturnItems; if (Returned.Count == 0) { return; } ; if (conditionalIndex.HasValue) { ItemList[n].Conditional[conditionalIndex.Value] = Returned; } else { ItemList[n].Conditional.Add(Returned); } FillConditional(n); } ; }
private void button_goto_Click(object sender, EventArgs e) { var itemSelect = new fItemSelect(checkboxes: false); var result = itemSelect.ShowDialog(); if (result == DialogResult.OK && fItemSelect.ReturnItems.Any()) { var itemIndex = fItemSelect.ReturnItems.First(); nItem.Value = itemIndex; } }
private void UpdateConditional(int n) { fItemSelect ItemSelect = new fItemSelect(); DialogResult R = ItemSelect.ShowDialog(); if (R == DialogResult.OK) { List <int> Returned = fItemSelect.ReturnItems; if (Returned.Count == 0) { return; } ; ItemList[n].Conditional.Add(Returned); FillConditional(n); } ; }
private void lConditional_MouseDoubleClick(object sender, MouseEventArgs e) { var index = lConditional.IndexFromPoint(e.Location); if (index != ListBox.NoMatches) { var conditions = ItemList[n].Conditional[index]; if (conditions.Count == 1) { nItem.Value = conditions[0]; } else { var itemSelect = new fItemSelect(checkboxes: false, highlightedItems: conditions); var result = itemSelect.ShowDialog(); if (result == DialogResult.OK && fItemSelect.ReturnItems.Any()) { var itemIndex = fItemSelect.ReturnItems.First(); nItem.Value = itemIndex; } } } }