Exemplo n.º 1
0
        private void AddFilter()
        {
            FormFilterDetails formDetails = new FormFilterDetails();

            Solver.Filter filter = formDetails.ShowDialog(null);
            if (filter == null)
            {
                return;
            }

            /*int index = listBoxFilters.SelectedIndex;
             * if (index == -1)
             *  index = listBoxFilters.Items.Count;
             * listBoxFilters.Items.Insert(index, filter);*/
            listBoxFilters.Items.Add(filter);
            listBoxFilters.SelectedIndex = listBoxFilters.Items.Count - 1;

            // not preset anymore
            ddPresets.SelectedIndex = -1;
        }
Exemplo n.º 2
0
        private void EditFilter()
        {
            int index = listBoxFilters.SelectedIndex;

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

            Solver.Filter     filter      = (Solver.Filter)listBoxFilters.SelectedItem;
            FormFilterDetails formDetails = new FormFilterDetails();

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

            // not preset anymore
            ddPresets.SelectedIndex = -1;
        }
Exemplo n.º 3
0
        private void EditFilter()
        {
            int index = listBoxFilters.SelectedIndex;
            if (index == -1)
                return;

            Solver.Filter filter = (Solver.Filter)listBoxFilters.SelectedItem;
            FormFilterDetails formDetails = new FormFilterDetails();
            filter = formDetails.ShowDialog(filter);
            if (filter == null)
                return;
            listBoxFilters.Items.RemoveAt(index);
            listBoxFilters.Items.Insert(index, filter);
            listBoxFilters.SelectedIndex = index;

            // not preset anymore
            ddPresets.SelectedIndex = -1;
        }
Exemplo n.º 4
0
        private void AddFilter()
        {
            FormFilterDetails formDetails = new FormFilterDetails();
            Solver.Filter filter = formDetails.ShowDialog(null);
            if (filter == null)
                return;
            /*int index = listBoxFilters.SelectedIndex;
            if (index == -1)
                index = listBoxFilters.Items.Count;
            listBoxFilters.Items.Insert(index, filter);*/
            listBoxFilters.Items.Add(filter);
            listBoxFilters.SelectedIndex = listBoxFilters.Items.Count - 1;

            // not preset anymore
            ddPresets.SelectedIndex = -1;
        }