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 bool Accept() { try { fBase.Context.Tree.Header.Language = GEDCOMUtils.GetLanguageVal(fView.Language.Text); GDMSubmitterRecord submitter = fBase.Context.Tree.GetSubmitter(); submitter.Name.StringValue = fView.Name.Text; submitter.Address.SetAddressArray(fView.Address.Lines); if (submitter.Address.PhoneNumbers.Count > 0) { submitter.Address.PhoneNumbers[0].StringValue = fView.Tel.Text; } else { submitter.Address.AddPhoneNumber(fView.Tel.Text); } fBase.NotifyRecord(submitter, RecordAction.raEdit); return(true); } catch (Exception ex) { Logger.WriteError("FilePropertiesDlgController.Accept()", ex); return(false); } }
public LangRecord(int code, string sign, string name, string fileName) { Code = code; Sign = sign; Name = name; FileName = fileName; string engLangName = ConvertHelper.UniformName(Path.GetFileNameWithoutExtension(fileName)); LangID = GEDCOMUtils.GetLanguageVal(engLangName); }
public override string ParseString(string strValue) { fValue = GEDCOMUtils.GetLanguageVal(strValue); return(string.Empty); }