private void SaveSettings() { Photograph photo = Photo; if (photo != null) { photo.BeginEdit(); photo.Caption = txtCaption.Text; photo.Photographer = cmbPhotographer.Text; photo.Notes = txtNotes.Text; try { photo.DateTaken = dtpDateTaken.Value; } catch (FormatException) { } photo.EndEdit(); } }