//*************************************************************************** // Private Methods // private void PopulateNoteList() { this.lvwNotes.BeginUpdate(); try { lvwNotes.Items.Clear(); for (int i = 0; i < this._noteCol.Count; i++) { ProjectNote note = this._noteCol[i]; this.lvwNotes.Items.Add(new ListViewItem(new string[] { "", note.Subject, note.Body })); } } catch (Exception ex) { #if DEBUG MessageBox.Show(this, ex.ToString(), "Unexpected Error"); #else MessageBox.Show(this, "An unexpected error occured while trying to display project notes:\n\n" + ex.Message, "Unexpected Error"); #endif } finally { this.lvwNotes.EndUpdate(); } }
private void lvwNotes_onDoubleClick(object sender, EventArgs e) { if (this.lvwNotes.SelectedIndices.Count > 0) { ProjectNote note = this._noteCol[this.lvwNotes.SelectedIndices[0]]; using (frmProjectNote frm = new frmProjectNote(note.Subject, note.Body)) if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.Subject != note.Subject || frm.Body != note.Body) { this._noteCol[this.lvwNotes.SelectedIndices[0]] = frm.Note; this.PopulateNoteList(); } } } }