private void SetCommunication(GEDCOMCommunicationRecord value) { fCommunication = value; try { if (fCommunication == null) { txtName.Text = ""; cmbCorrType.SelectedIndex = -1; txtDate.Text = ""; txtDir.SelectedIndex = 0; txtCorresponder.Text = ""; } else { txtName.Text = fCommunication.CommName; cmbCorrType.SelectedIndex = (int)fCommunication.CommunicationType; txtDate.Text = fCommunication.Date.GetDisplayString(DateFormat.dfDD_MM_YYYY); var corr = fCommunication.GetCorresponder(); fTempInd = corr.Corresponder; if (fTempInd != null) { txtDir.SelectedIndex = (int)corr.CommDir; txtCorresponder.Text = GKUtils.GetNameString(fTempInd, true, false); } else { txtDir.SelectedIndex = 0; txtCorresponder.Text = ""; } } fNotesList.ListModel.DataOwner = fCommunication; fMediaList.ListModel.DataOwner = fCommunication; } catch (Exception ex) { Logger.LogWrite("CommunicationEditDlg.SetCommunication(): " + ex.Message); } }
public override void UpdateView() { try { fView.NotesList.ListModel.DataOwner = fCommunication; fView.MediaList.ListModel.DataOwner = fCommunication; if (fCommunication == null) { fView.Name.Text = ""; fView.CorrType.SelectedIndex = -1; fView.Date.Text = ""; fView.Dir.SelectedIndex = 0; fView.Corresponder.Text = ""; } else { fView.Name.Text = fCommunication.CommName; fView.CorrType.SelectedIndex = (int)fCommunication.CommunicationType; fView.Date.Text = fCommunication.Date.GetDisplayString(DateFormat.dfDD_MM_YYYY); var corr = fCommunication.GetCorresponder(); fTempInd = corr.Corresponder; if (fTempInd != null) { fView.Dir.SelectedIndex = (int)corr.CommDir; fView.Corresponder.Text = GKUtils.GetNameString(fTempInd, true, false); } else { fView.Dir.SelectedIndex = 0; fView.Corresponder.Text = ""; } } } catch (Exception ex) { Logger.LogWrite("CommunicationEditDlgController.SetCommunication(): " + ex.Message); } }