private PersonNameGroup GetGroup(string group) { PersonNameGroup sGroup = new PersonNameGroup(); sGroup.OrginalName = group; string[] sList = sGroup.OrginalName.Split(DPersonName.ComponentDelimiter); if (sList.Length > 0) { sGroup.FamilyName = sList[0]; } if (sList.Length > 1) { sGroup.GivenName = sList[1]; } if (sList.Length > 2) { sGroup.MiddleName = sList[2]; } if (sList.Length > 3) { sGroup.Prefix = sList[3]; } if (sList.Length > 4) { sGroup.Suffix = sList[4]; } return(sGroup); }
private string GetName(PersonNameGroup group) { StringBuilder sb = new StringBuilder(); foreach (PersonNameComponent c in Components) { switch (c.Type) { case PersonNameComponentType.FamilyName: sb.Append(group.FamilyName); sb.Append(DPersonName.ComponentDelimiter); break; case PersonNameComponentType.GivenName: sb.Append(group.GivenName); sb.Append(DPersonName.ComponentDelimiter); break; case PersonNameComponentType.MiddleName: sb.Append(group.MiddleName); sb.Append(DPersonName.ComponentDelimiter); break; case PersonNameComponentType.Prefix: sb.Append(group.Prefix); sb.Append(DPersonName.ComponentDelimiter); break; case PersonNameComponentType.Suffix: sb.Append(group.Suffix); sb.Append(DPersonName.ComponentDelimiter); break; } } string str = sb.ToString().Trim(DPersonName.ComponentDelimiter); return(str = str.Replace(DPersonName.ComponentDelimiter, '*')); }