private void editAdjustmentButton_Click(object sender, EventArgs e) { if (adjustmentsListBox.SelectedIndex >= 0 && currentResponseList.Adjustments.Count > adjustmentsListBox.SelectedIndex) { // hopefully the indices of the listbox will always match those of the adjustment list AdjustmentForm af = new AdjustmentForm(currentResponseList.Adjustments.ElementAt(adjustmentsListBox.SelectedIndex)); af.ShowDialog(); if (!af.Cancelled) { currentResponseList.Adjustments[adjustmentsListBox.SelectedIndex] = af.GraderAdjustment; updateAdjustmentListBox(); } updatePoints(); } }
private void addAdjustmentButton_Click(object sender, EventArgs e) { AdjustmentForm af = new AdjustmentForm(new Adjustment()); af.ShowDialog(); if (!af.Cancelled) { currentResponseList.Adjustments.Add(af.GraderAdjustment); updateAdjustmentListBox(); } updatePoints(); }