private void FilterList_SelectedIndexChanged(object sender, EventArgs e) { //Handles picking filters out of filter list // Toggle the checked status then save it to the configuration list accordingly // SessionControl openSession = new SessionControl(); TargetPlan tPlan = new TargetPlan(openSession.CurrentTargetName); string flistname = FilterListBox.GetItemText(FilterListBox.SelectedItem); string fname = (flistname.Split('-')[0]); int findex = Convert.ToInt32(flistname.Split('-')[1]); Filter fobj = new Filter(fname, findex, 1); //Get the current filter list //Add to configuration, assuming that it wasn't already if (FilterListBox.GetItemChecked(FilterListBox.SelectedIndex)) { tPlan.SetFilter(fobj, true); } else { tPlan.SetFilter(fobj, false); } }