예제 #1
0
        public FamilyInfo(ParentFamilyStatus parentFamilyStatus, IEnumerable <RelativeInfo> relatives)
            : this(parentFamilyStatus)
        {
            if (relatives == null)
            {
                throw new ArgumentNullException(nameof(relatives));
            }

            foreach (var relative in relatives)
            {
                AddRelative(relative);
            }
        }
예제 #2
0
        public static string ToParentFamilyStatusString(this ParentFamilyStatus source)
        {
            switch (source)
            {
            case ParentFamilyStatus.Full: return("Полная");

            case ParentFamilyStatus.OnlyMother: return("Только мать");

            case ParentFamilyStatus.OnlyFather: return("Только отец");

            case ParentFamilyStatus.Relatives: return("Родственники");

            case ParentFamilyStatus.Guardianship: return("Опекунство");

            case ParentFamilyStatus.BoardingSchool: return("Школа-интернат");

            case ParentFamilyStatus.AnOrphan: return("Сирота");
            }

            return(string.Empty);
        }
예제 #3
0
        public FamilyInfo(ParentFamilyStatus parentFamilyStatus)
        {
            ParentFamilyStatus = parentFamilyStatus;

            _relatives = new RelativeInfo[MaxRelativesCount];
        }
예제 #4
0
 public override int GetHashCode()
 {
     return(ParentFamilyStatus.GetHashCode() ^ Relatives.GetHashCode());
 }
예제 #5
0
 public void ChangeParentFamilyStatus(ParentFamilyStatus parentFamilyStatus)
 {
     ParentFamilyStatus = parentFamilyStatus;
 }