public void SelectSolutionBySol(PackPalletSolution sol) { if (HasSolutionSelected(sol)) { return; } // instantiate new SelSolution var selSolution = new SelPackPalletSolution(ParentDocument, this, sol); // insert in list _selectedSolutions.Add(selSolution); // fire event SolutionSelected?.Invoke(this, selSolution); // set document modified (not analysis, otherwise selected solutions are erased) ParentDocument.Modify(); }
public void SelectSolutionByIndex(int index) { if (index < 0 || index > _solutions.Count) { return; // no solution with this index } if (HasSolutionSelected(index)) { return; } // instantiate new SelSolution var selSolution = new SelPackPalletSolution(ParentDocument, this, _solutions[index]); // insert in list _selectedSolutions.Add(selSolution); // fire event SolutionSelected?.Invoke(this, selSolution); // set document modified (not analysis, otherwise selected solutions are erased) ParentDocument.Modify(); }