public LanguageEditDlgController(ILanguageEditDlg view) : base(view) { for (var lid = GDMLanguageID.Unknown; lid < GDMLanguageID.Yiddish; lid++) { fView.LanguageCombo.AddItem(GEDCOMUtils.GetLanguageStr(lid), lid); } }
public void Test_GEDCOMEnumLang() { Assert.AreEqual(GDMLanguageID.Unknown, GEDCOMUtils.GetLanguageVal(GEDCOMUtils.GetLanguageStr(GDMLanguageID.Unknown))); Assert.AreEqual(GDMLanguageID.AncientGreek, GEDCOMUtils.GetLanguageVal(GEDCOMUtils.GetLanguageStr(GDMLanguageID.AncientGreek))); Assert.AreEqual(GDMLanguageID.Esperanto, GEDCOMUtils.GetLanguageVal(GEDCOMUtils.GetLanguageStr(GDMLanguageID.Esperanto))); Assert.AreEqual(GDMLanguageID.Russian, GEDCOMUtils.GetLanguageVal(GEDCOMUtils.GetLanguageStr(GDMLanguageID.Russian))); Assert.AreEqual(GDMLanguageID.Sumerian, GEDCOMUtils.GetLanguageVal(GEDCOMUtils.GetLanguageStr(GDMLanguageID.Sumerian))); Assert.AreEqual(GDMLanguageID.Urdu, GEDCOMUtils.GetLanguageVal(GEDCOMUtils.GetLanguageStr(GDMLanguageID.Urdu))); Assert.AreEqual(GDMLanguageID.Vietnamese, GEDCOMUtils.GetLanguageVal(GEDCOMUtils.GetLanguageStr(GDMLanguageID.Vietnamese))); Assert.AreEqual(GDMLanguageID.Wendic, GEDCOMUtils.GetLanguageVal(GEDCOMUtils.GetLanguageStr(GDMLanguageID.Wendic))); Assert.AreEqual(GDMLanguageID.Yiddish, GEDCOMUtils.GetLanguageVal(GEDCOMUtils.GetLanguageStr(GDMLanguageID.Yiddish))); for (var lid = GDMLanguageID.Unknown; lid < GDMLanguageID.Yiddish; lid++) { string strVal = GEDCOMUtils.GetLanguageStr(lid); GDMLanguageID val = GEDCOMUtils.GetLanguageVal(strVal); Assert.AreEqual(lid, val); } }
public override void UpdateContents() { var iRec = fDataOwner as GDMIndividualRecord; if (fSheetList == null || iRec == null) { return; } try { fSheetList.BeginUpdate(); fSheetList.ClearItems(); foreach (GDMPersonalName pn in iRec.PersonalNames) { string lang = GEDCOMUtils.GetLanguageStr(pn.Language); fSheetList.AddItem(pn, new object[] { GKUtils.GetNameString(iRec, pn, true, false), LangMan.LS(GKData.NameTypes[(int)pn.NameType]), lang }); } fSheetList.EndUpdate(); } catch (Exception ex) { Logger.WriteError("NamesSublistModel.UpdateContents()", ex); } }
public void ChangeLanguage() { using (var dlg = AppHost.ResolveDialog <ILanguageEditDlg>()) { dlg.LanguageID = fBase.Context.Tree.Header.Language; if (dlg.ShowModalX(this)) { // Assignment in control, instead of the header's property to work Cancel. fView.Language.Text = GEDCOMUtils.GetLanguageStr(dlg.LanguageID); } } }
public PersonalNameEditDlgController(IPersonalNameEditDlg view) : base(view) { for (GDMNameType nt = GDMNameType.ntNone; nt <= GDMNameType.ntMarried; nt++) { fView.NameType.Add(LangMan.LS(GKData.NameTypes[(int)nt])); } for (var lid = GDMLanguageID.Unknown; lid < GDMLanguageID.Yiddish; lid++) { fView.Language.AddItem(GEDCOMUtils.GetLanguageStr(lid), lid); } fView.Language.Sort(); }
public override void UpdateView() { fView.Language.Text = GEDCOMUtils.GetLanguageStr(fBase.Context.Tree.Header.Language); GDMSubmitterRecord submitter = fBase.Context.Tree.GetSubmitter(); fView.Name.Text = submitter.Name.FullName; fView.Address.Text = submitter.Address.Lines.Text; if (submitter.Address.PhoneNumbers.Count > 0) { fView.Tel.Text = submitter.Address.PhoneNumbers[0].StringValue; } // update stats int[] stats = fBase.Context.Tree.GetRecordStats(); fView.RecordStats.ClearItems(); for (int i = 1; i < stats.Length; i++) { fView.RecordStats.AddItem(null, LangMan.LS(GKData.RecordTypes[i]), stats[i].ToString()); } }
public override void UpdateView() { GDMIndividualRecord iRec = fPersonalName.Owner as GDMIndividualRecord; var parts = GKUtils.GetNameParts(iRec, fPersonalName, false); fView.Surname.Text = parts.Surname; fView.Name.Text = parts.Name; fView.Patronymic.Text = parts.Patronymic; fView.NameType.SelectedIndex = (sbyte)fPersonalName.NameType; fView.NamePrefix.Text = fPersonalName.Pieces.Prefix; fView.Nickname.Text = fPersonalName.Pieces.Nickname; fView.SurnamePrefix.Text = fPersonalName.Pieces.SurnamePrefix; fView.NameSuffix.Text = fPersonalName.Pieces.Suffix; fView.MarriedSurname.Text = fPersonalName.Pieces.MarriedName; if (!IsExtendedWomanSurname()) { fView.SurnameLabel.Text = LangMan.LS(LSID.LSID_Surname); fView.MarriedSurname.Enabled = false; } else { fView.SurnameLabel.Text = LangMan.LS(LSID.LSID_MaidenSurname); fView.MarriedSurname.Enabled = true; } ICulture culture = fBase.Context.Culture; fView.Surname.Enabled = fView.Surname.Enabled && culture.HasSurname(); fView.Patronymic.Enabled = fView.Patronymic.Enabled && culture.HasPatronymic(); GDMLanguageID langID = fPersonalName.Language; fView.Language.Text = GEDCOMUtils.GetLanguageStr(langID); }
public override void UpdateView() { fView.LanguageCombo.Text = GEDCOMUtils.GetLanguageStr(fLanguageID); }
protected override string GetStringValue() { return(GEDCOMUtils.GetLanguageStr(fValue)); }