예제 #1
0
        private string FormatJSONContact(ContactInformation con, string[] fields)
        {
            string contactFormatStr = "\"id\":\"{0}\"," +
                                      "\"displayName\":\"{1}\"," +
                                      "\"phoneNumbers\":[{2}]," +
                                      "\"emails\":[{3}]," +
                                      "\"addresses\":[{4}]";


            string jsonContact = String.Format(contactFormatStr,
                                               con.GetHashCode(),
                                               con.Name,
                                               FormatJSONPhoneNumbers(con),
                                               FormatJSONEmails(con),
                                               FormatJSONAddresses(con));

            return("{" + jsonContact.Replace("\n", "\\n") + "}");
        }
예제 #2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (Version.Length != 0)
            {
                hash ^= Version.GetHashCode();
            }
            hash ^= authors_.GetHashCode();
            if (Copyrights.Length != 0)
            {
                hash ^= Copyrights.GetHashCode();
            }
            if (ContactInformation.Length != 0)
            {
                hash ^= ContactInformation.GetHashCode();
            }
            if (Reference.Length != 0)
            {
                hash ^= Reference.GetHashCode();
            }
            if (thumbnailImage_ != null)
            {
                hash ^= ThumbnailImage.GetHashCode();
            }
            if (AvatarPermission != global::VrmProtobuf.Meta.Types.AvatarPermissionType.OnlyAuthor)
            {
                hash ^= AvatarPermission.GetHashCode();
            }
            if (ViolentUsage != false)
            {
                hash ^= ViolentUsage.GetHashCode();
            }
            if (SexualUsage != false)
            {
                hash ^= SexualUsage.GetHashCode();
            }
            if (GameUsage != false)
            {
                hash ^= GameUsage.GetHashCode();
            }
            if (CommercialUsage != global::VrmProtobuf.Meta.Types.CommercialUsageType.PersonalNonCommercialNonProfit)
            {
                hash ^= CommercialUsage.GetHashCode();
            }
            if (PoliticalOrReligiousUsage != false)
            {
                hash ^= PoliticalOrReligiousUsage.GetHashCode();
            }
            if (OtherPermissionUrl.Length != 0)
            {
                hash ^= OtherPermissionUrl.GetHashCode();
            }
            if (CreditNotation != global::VrmProtobuf.Meta.Types.CreditNotationType.Required)
            {
                hash ^= CreditNotation.GetHashCode();
            }
            if (AllowRedistribution != false)
            {
                hash ^= AllowRedistribution.GetHashCode();
            }
            if (Modify != global::VrmProtobuf.Meta.Types.ModifyType.Prohibited)
            {
                hash ^= Modify.GetHashCode();
            }
            if (OtherLicenseUrl.Length != 0)
            {
                hash ^= OtherLicenseUrl.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
 public void GetHashCode_ForHome_Passes()
 {
     Expect(contactInformationFixture_Home.GetHashCode(), Is.EqualTo(contactInformationFixture_Home.Clone().GetHashCode()));
 }