Exemplo n.º 1
0
 public override int GetHashCode()
 {
     unchecked {
         const int randomPrime = 397;
         int       hashCode    = Id.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ SourceTypeID.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ SourceId.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ (Name_Latin != null ? Name_Latin.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (FamilyName_Latin != null ? FamilyName_Latin.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (Name_Cyrillic != null ? Name_Cyrillic.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (FamilyName_Cyrillic != null ? FamilyName_Cyrillic.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (Sex != null ? Sex.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (FatherName != null ? FatherName.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (DateOfBirth != null ? DateOfBirth.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (Citizenship != null ? Citizenship.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (PlaceOfBirthId != null ? PlaceOfBirthId.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (PlaceOfEmigrationId != null ? PlaceOfEmigrationId.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (PlaceOfLivingId != null ? PlaceOfLivingId.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (FatherId != null ? FatherId.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (MotherId != null ? MotherId.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (MaritalStatus != null ? MaritalStatus.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (PartnerId != null ? PartnerId.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (Profession != null ? Profession.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (Notice != null ? Notice.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (PhotoNumber != null ? PhotoNumber.GetHashCode() : 0);
         return(hashCode);
     }
 }
Exemplo n.º 2
0
    void Populate(Notice notice)
    {
        newObj = (GameObject)Instantiate(prefab, noticeContent.transform);

        newObj.name = notice.GetHashCode().ToString();

        // Notice Title 출력
        //var texts = newObj.GetComponents<Text>();
        //var text = newObj.GetComponent<Text>();
        //text.text = notice.Title;

        // 접속 버튼
        Button button = newObj.GetComponentInChildren <Button>();

        button.GetComponentInChildren <Text>().text = notice.Title;
        button.onClick.AddListener(delegate { NoticePop.Instance().SetNotice(notice); });
    }