Example #1
0
        /// <summary>
        /// The PInfo class is defined to be equal if, for all sections where both names are defined (minimum two), none are not equal
        /// </summary>
        /// <param name="b"></param>
        /// <returns></returns>
        public bool Equals(PInfo b)
        {
            int i = 0;

            if (Prefix != null && b.Prefix != null)
            {
                if (!Prefix.Equals(b.Prefix))
                {
                    return(false);
                }
                i++;
            }
            if (FirstName != null && b.FirstName != null)
            {
                if (!FirstName.Equals(b.FirstName))
                {
                    return(false);
                }
                i++;
            }
            if (MiddleName != null && b.MiddleName != null)
            {
                if (!MiddleName.Equals(b.MiddleName))
                {
                    return(false);
                }
                i++;
            }
            if (LastName != null && b.LastName != null)
            {
                if (!LastName.Equals(b.LastName))
                {
                    return(false);
                }
                i++;
            }
            if (Suffix != null && b.Suffix != null)
            {
                if (!Suffix.Equals(b.Suffix))
                {
                    return(false);
                }
                i++;
            }
            if (i < 2)
            {
                return(false);
            }

            return(true);
        }
Example #2
0
 public Person(PInfo info, List <Relations <Person, int> > relations)
 {
     _info      = info;
     _relations = relations;
 }