Esempio n. 1
0
 public void UnSelectSolution(SelHCylinderPalletSolution selSolution)
 {
     if (null == selSolution)
     {
         return;                      // this solution not selected
     }
     // remove from list
     _selectedSolutions.Remove(selSolution);
     ParentDocument.RemoveItem(selSolution);
     // fire event
     SolutionSelectionRemoved?.Invoke(this, selSolution);
     // set document modified (not analysis, otherwise selected solutions are erased)
     ParentDocument.Modify();
 }
Esempio n. 2
0
        public void SelectSolutionByIndex(int index)
        {
            if (index < 0 || index > _solutions.Count)
            {
                return;  // no solution with this index
            }
            if (HasSolutionSelected(index))
            {
                return;                                         // solution already selected
            }
            // instantiate new SelSolution
            SelHCylinderPalletSolution selSolution = new SelHCylinderPalletSolution(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();
        }