/// <summary> /// Determines whether this instance and another specified <see cref="PersonStatus"/> object have the same value. /// </summary> /// <param name="value">The person status to compare to this instance.</param> /// <returns>true if the value of the parameter is the same as the value of this instance; otherwise, false. If value is null, the method returns false.</returns> public bool Equals(PersonStatus value) { if (Object.ReferenceEquals(value, null)) { return(false); } if (Object.ReferenceEquals(this, value)) { return(true); } return(this.Name == value.Name); }
/// <summary> /// Parse person status. /// </summary> /// <param name="name">Name of the person status.</param> /// <returns><see cref="PersonStatus"/> for the name.</returns> public static PersonStatus Parse(string name) { PersonStatus personStatus = null; if (name == null) { personStatus = PersonStatus.Unknown; } else if (!PERSON_STATUSES.TryGetValue(name, out personStatus)) { personStatus = new PersonStatus(name); } return(personStatus); }