Example #1
0
        public int CompareTo(Name other)
        {
            int value = LastName.CompareTo(other.LastName);

            if (value != 0)
            {
                return(value);
            }
            value = FirstName.CompareTo(other.FirstName);
            if (value != 0)
            {
                return(value);
            }
            return(Honorific.CompareTo(other.Honorific));
        }
Example #2
0
        /// <summary>
        /// Converts the value of the specified <see cref="Honorific"/> to its equivalent <see cref="String"/> representation.
        /// </summary>
        /// <param name="honorific">An honorific.</param>
        /// <returns>The <see cref="String"/> equivalent of the value of <paramref name="honorific"/>.</returns>
        public static string ToString(Honorific honorific)
        {
            switch (honorific)
            {
            case Honorific.Mr: return("Mr.");

            case Honorific.Mrs: return("Mrs.");

            case Honorific.Ms: return("Ms.");

            case Honorific.Rev: return("Rev.");

            case Honorific.Sister: return("Sister");

            default: return(string.Empty);
            }
        }
Example #3
0
        public override string ToString()
        {
            List <string> nameParts = new List <string>(3);

            if (!string.IsNullOrWhiteSpace(Honorific) && !Honorific.Equals("--", StringComparison.InvariantCultureIgnoreCase))
            {
                nameParts.Add(Honorific);
            }
            if (!string.IsNullOrWhiteSpace(FirstName))
            {
                nameParts.Add(FirstName);
            }
            if (!string.IsNullOrWhiteSpace(LastName))
            {
                nameParts.Add(LastName);
            }
            return(string.Join(" ", nameParts));
        }
 public void SetHonorific(Honorific honorific)
 {
     BarAccount.HNR = $"{honorific.ToString()}\\.";
 }
Example #5
0
 public void SetHonorific(Honorific honorific)
 {
     FooAccount.Honorific = honorific;
 }