public void SetName(PartialNameType type, String name)
        {
            trace.TraceInformation("SetName(" + type + "," + name + ")");

            if (partialNameList.ContainsKey(type))
            {
                if (partialNameList[type].IndexOf(name) != 0)
                {
                    return;
                }
                if (name.IndexOf(partialNameList[type]) == -1)
                {
                    if (partialNameList[type].IndexOf(name) >= 0)
                    {
                        return;
                    }
                    else if (name.IndexOf(partialNameList[type]) >= 0)
                    {
                        // Replace current name with new, more complete, name
                    }
                    else
                    {
                        // Append names
                        name = name + " " + partialNameList[type];
                    }
                }
                partialNameList.Remove(type);
            }
            partialNameList.Add(type, name);
        }
        private string GetComplexNameTypes(PartialNameType type)
        {
            string name = "";

            if ((type == PartialNameType.PublicName) || (type == PartialNameType.NameString))
            {
                name = CheckAppend(name, PartialNameType.NamePrefix);
                name = CheckAppend(name, PartialNameType.GivenName);
                name = CheckAppend(name, PartialNameType.MiddleName);
                name = CheckAppend(name, PartialNameType.Nickname);
                name = CheckAppend(name, PartialNameType.SurnamePrefix);
                name = CheckAppend(name, PartialNameType.Surname);

                if (partialNameList.ContainsKey(PartialNameType.BirthSurname))
                {
                    bool include = true;
                    if (partialNameList.ContainsKey(PartialNameType.Surname))
                    {
                        if (partialNameList[PartialNameType.BirthSurname] == partialNameList[PartialNameType.Surname])
                        {
                            include = false;
                        }
                    }
                    if (include)
                    {
                        name = CheckAppend(name, PartialNameType.BirthSurname);
                    }
                }
                name = CheckAppend(name, PartialNameType.Suffix);
                trace.TraceInformation("GetComplexNameTypes(" + type + "):" + name);
            }
            return(name);
        }
 private string CheckAppend(string s1, PartialNameType type)
 {
     if (partialNameList.ContainsKey(type))
     {
         s1 = Append(s1, partialNameList[type]);
     }
     return(s1);
 }
        public bool IsNameTypeWritable(PartialNameType type)
        {
            if (type == PartialNameType.PublicName)
            {
                return(false);
            }

            return(true);
        }
        //private NameType nameType;
        //private String nameString;

        public PersonalNameClass(PartialNameType type = PartialNameType.Unknown, string name = null)
        {
            partialNameList = new Dictionary <PartialNameType, string>();
            //sourceList = new List<SourceClass>();
            //sourceXrefList = new List<SourceXrefClass>();
            //noteList = new List<NoteClass>();
            //noteXrefList = new List<NoteXrefClass>();
            if (name != null)
            {
                partialNameList.Add(type, name);
            }
        }
        public String GetName(PartialNameType type = PartialNameType.PublicName, bool gedcomFormat = false)
        {
            if (partialNameList.Count > 0)
            {
                if (partialNameList.ContainsKey(type))
                {
                    {
                        trace.TraceInformation("GetName(" + type + "):" + partialNameList[type]);
                    }
                    return(partialNameList[type]);
                }

                return(GetComplexNameTypes(type));
            }
            return("");
        }
 public bool IsNameTypeReadable(PartialNameType type)
 {
     return(true);
 }