Пример #1
0
        private void AddCriteria()
        {
            FormCriteriaDetails formDetails = new FormCriteriaDetails();

            Solver.Criteria criteria = formDetails.ShowDialog(null);
            if (criteria == null)
            {
                return;
            }
            int index = listBoxCriteria.SelectedIndex;

            if (index == -1)
            {
                index = listBoxCriteria.Items.Count;
            }
            listBoxCriteria.Items.Insert(index, criteria);

            ddPresets.SelectedIndex = -1;
        }
Пример #2
0
        private void EditCriteria()
        {
            int index = listBoxCriteria.SelectedIndex;

            if (index == -1)
            {
                return;
            }

            Solver.Criteria     criteria    = (Solver.Criteria)listBoxCriteria.SelectedItem;
            FormCriteriaDetails formDetails = new FormCriteriaDetails();

            criteria = formDetails.ShowDialog(criteria);
            if (criteria == null)
            {
                return;
            }
            listBoxCriteria.Items.RemoveAt(index);
            listBoxCriteria.Items.Insert(index, criteria);
            listBoxCriteria.SelectedIndex = index;

            ddPresets.SelectedIndex = -1;
        }
Пример #3
0
        private void EditCriteria()
        {
            int index = listBoxCriteria.SelectedIndex;
            if (index == -1)
                return;

            Solver.Criteria criteria = (Solver.Criteria)listBoxCriteria.SelectedItem;
            FormCriteriaDetails formDetails = new FormCriteriaDetails();
            criteria = formDetails.ShowDialog(criteria);
            if (criteria == null)
                return;
            listBoxCriteria.Items.RemoveAt(index);
            listBoxCriteria.Items.Insert(index, criteria);
            listBoxCriteria.SelectedIndex = index;

            ddPresets.SelectedIndex = -1;
        }
Пример #4
0
        private void AddCriteria()
        {
            FormCriteriaDetails formDetails = new FormCriteriaDetails();
            Solver.Criteria criteria = formDetails.ShowDialog(null);
            if (criteria == null)
                return;
            int index = listBoxCriteria.SelectedIndex;
            if (index == -1)
                index = listBoxCriteria.Items.Count;
            listBoxCriteria.Items.Insert(index, criteria);

            ddPresets.SelectedIndex = -1;
        }