Example #1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (CountryId != null)
         {
             hashCode = hashCode * 59 + CountryId.GetHashCode();
         }
         if (NewCountryId != null)
         {
             hashCode = hashCode * 59 + NewCountryId.GetHashCode();
         }
         if (IsPrimary != null)
         {
             hashCode = hashCode * 59 + IsPrimary.GetHashCode();
         }
         if (SessionToken != null)
         {
             hashCode = hashCode * 59 + SessionToken.GetHashCode();
         }
         return(hashCode);
     }
 }
        /// <summary>
        /// Returns true if CitizenshipModel3 instances are equal
        /// </summary>
        /// <param name="other">Instance of CitizenshipModel3 to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(CitizenshipModel3 other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     NewCountryId == other.NewCountryId ||
                     NewCountryId != null &&
                     NewCountryId.Equals(other.NewCountryId)
                     ) &&
                 (
                     IsPrimary == other.IsPrimary ||
                     IsPrimary != null &&
                     IsPrimary.Equals(other.IsPrimary)
                 ) &&
                 (
                     SessionToken == other.SessionToken ||
                     SessionToken != null &&
                     SessionToken.Equals(other.SessionToken)
                 ));
        }
Example #3
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (int)EventType;
         hashCode = (hashCode * 397) ^ (int)DeviceType;
         hashCode = (hashCode * 397) ^ (int)PointerId;
         hashCode = (hashCode * 397) ^ Position.GetHashCode();
         hashCode = (hashCode * 397) ^ Timestamp.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)KeyModifiers;
         hashCode = (hashCode * 397) ^ ContactRect.GetHashCode();
         hashCode = (hashCode * 397) ^ IsBarrelButtonPressed.GetHashCode();
         hashCode = (hashCode * 397) ^ IsCanceled.GetHashCode();
         hashCode = (hashCode * 397) ^ IsEraser.GetHashCode();
         hashCode = (hashCode * 397) ^ IsHorizontalMouseWheel.GetHashCode();
         hashCode = (hashCode * 397) ^ IsInRange.GetHashCode();
         hashCode = (hashCode * 397) ^ IsInverted.GetHashCode();
         hashCode = (hashCode * 397) ^ IsLeftButtonPressed.GetHashCode();
         hashCode = (hashCode * 397) ^ IsMiddleButtonPressed.GetHashCode();
         hashCode = (hashCode * 397) ^ IsRightButtonPressed.GetHashCode();
         hashCode = (hashCode * 397) ^ IsXButton1Pressed.GetHashCode();
         hashCode = (hashCode * 397) ^ IsXButton2Pressed.GetHashCode();
         hashCode = (hashCode * 397) ^ IsPrimary.GetHashCode();
         hashCode = (hashCode * 397) ^ MouseWheelDelta;
         hashCode = (hashCode * 397) ^ Orientation.GetHashCode();
         hashCode = (hashCode * 397) ^ TouchConfidence.GetHashCode();
         hashCode = (hashCode * 397) ^ Twist.GetHashCode();
         hashCode = (hashCode * 397) ^ XTilt.GetHashCode();
         hashCode = (hashCode * 397) ^ YTilt.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)PointerUpdateKind;
         return(hashCode);
     }
 }
Example #4
0
        /// <summary>
        /// Returns the hashcode for this <see cref="DbField"/>.
        /// </summary>
        /// <returns>The hashcode value.</returns>
        public override int GetHashCode()
        {
            if (m_hashCode != null)
            {
                return(m_hashCode.Value);
            }

            var hashCode = 0;

            // Set the hashcode
            hashCode = Name.GetHashCode() + IsPrimary.GetHashCode() + IsIdentity.GetHashCode() + IsNullable.GetHashCode();
            if (Type != null)
            {
                hashCode += Type.GetHashCode();
            }
            if (Size != null)
            {
                hashCode += Size.GetHashCode();
            }
            if (Precision != null)
            {
                hashCode += Precision.GetHashCode();
            }
            if (Scale != null)
            {
                hashCode += Scale.GetHashCode();
            }
            if (DatabaseType != null)
            {
                hashCode += DatabaseType.GetHashCode();
            }

            // Set and return the hashcode
            return((m_hashCode = hashCode).Value);
        }
Example #5
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            int hash = base.GetHashCode();

            hash = hash * 23 + IsPrimary.GetHashCode();
            hash = hash * 23 + IsReplyRequired.GetHashCode();

            return(hash);
        }
Example #6
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Nickname != null)
         {
             hashCode = hashCode * 59 + Nickname.GetHashCode();
         }
         if (CountryId != null)
         {
             hashCode = hashCode * 59 + CountryId.GetHashCode();
         }
         if (Zip != null)
         {
             hashCode = hashCode * 59 + Zip.GetHashCode();
         }
         if (City != null)
         {
             hashCode = hashCode * 59 + City.GetHashCode();
         }
         if (AdministrativeArea != null)
         {
             hashCode = hashCode * 59 + AdministrativeArea.GetHashCode();
         }
         if (DependentLocality != null)
         {
             hashCode = hashCode * 59 + DependentLocality.GetHashCode();
         }
         if (SortingCode != null)
         {
             hashCode = hashCode * 59 + SortingCode.GetHashCode();
         }
         if (Organization != null)
         {
             hashCode = hashCode * 59 + Organization.GetHashCode();
         }
         if (AddressLine1 != null)
         {
             hashCode = hashCode * 59 + AddressLine1.GetHashCode();
         }
         if (AddressLine2 != null)
         {
             hashCode = hashCode * 59 + AddressLine2.GetHashCode();
         }
         if (IsPrimary != null)
         {
             hashCode = hashCode * 59 + IsPrimary.GetHashCode();
         }
         if (SessionToken != null)
         {
             hashCode = hashCode * 59 + SessionToken.GetHashCode();
         }
         return(hashCode);
     }
 }
 public void Validate()
 {
     PlanName.ValidateRequired("PlanName");
     CoverageType.ValidateOptional("CoverageType");
     SubscriberDob.ValidateOptional("SubscriberDob");
     IsPrimary.ValidateOptional("IsPrimary");
     ExpirationDate.ValidateOptional("ExpirationDate");
     Contact.ValidateOptional("Contact");
 }
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Id;
         hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Uom != null ? Uom.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IsPrimary.GetHashCode();
         hashCode = (hashCode * 397) ^ GroupId;
         hashCode = (hashCode * 397) ^ (Group != null ? Group.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (int)ValueType;
         //hashCode = (hashCode*397) ^ (Values != null ? Values.GetHashCode() : 0);
         return(hashCode);
     }
 }
Example #9
0
        public void WriteXml(XmlWriter writer)
        {
            //Write start of main elemenst
            writer.WriteStartElement("portalAlias");

            //write out properties
            writer.WriteElementString("portalID", PortalID.ToString());
            writer.WriteElementString("portalAliasID", PortalAliasID.ToString());
            writer.WriteElementString("HTTPAlias", HTTPAlias);
            writer.WriteElementString("skin", Skin);
            writer.WriteElementString("cultureCode", CultureCode);
            writer.WriteElementString("browserType", BrowserType.ToString().ToLowerInvariant());
            writer.WriteElementString("primary", IsPrimary.ToString().ToLowerInvariant());

            //Write end of main element
            writer.WriteEndElement();
        }
Example #10
0
        public override int GetHashCode()
        {
            int hashCode = 2030292606;

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(InviteLink);

            hashCode = hashCode * -1521134295 + EqualityComparer <User> .Default.GetHashCode(Creator);

            hashCode = hashCode * -1521134295 + CreatesJoinRequest.GetHashCode();
            hashCode = hashCode * -1521134295 + IsPrimary.GetHashCode();
            hashCode = hashCode * -1521134295 + IsRevoked.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Name);

            hashCode = hashCode * -1521134295 + ExpireDate.GetHashCode();
            hashCode = hashCode * -1521134295 + MemberLimit.GetHashCode();
            hashCode = hashCode * -1521134295 + PendingJoinRequestCount.GetHashCode();
            return(hashCode);
        }
        public bool Equals(ParametricModel other)
        {
            if (other == null)
            {
                return(false);
            }

            var allAreEqual = Id == other.Id && string.Equals(Name, other.Name) && string.Equals(Description, other.Description) &&
                              string.Equals(Uom, other.Uom) && IsPrimary.Equals(other.IsPrimary) && GroupId == other.GroupId &&
                              string.Equals(Group, other.Group) && ValueType == other.ValueType && string.Equals(Code, other.Code);

            if (!allAreEqual)
            {
                return(false);
            }

            return(ReferenceEquals(Values, other.Values) || (Values != null && other.Values != null && Values.SequenceEqual(other.Values)));
        }
Example #12
0
        private string LoadJson()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("\"IsPrimary\":" + IsPrimary.ToString().ToLower() + "");
            sb.Append(",\"IsAssociation\":" + IsAssociation.ToString().ToLower() + "");
            Type eType = DataType.GetEntityType();

            sb.Append(",\"Association\":{" + ((IsAssociation && eType != null) ? (
                                                  "\"FullName\":\"" + eType.FullName + "\"" +
                                                  ",\"Type\":\"" + eType.Name + "\"" +
                                                  ",\"Namespace\":\"" + eType.Namespace + "\""
                                                  ) : string.Empty) + "}");
            sb.Append(",\"IsRequired\":" + IsRequired.ToString().ToLower() + "");
            sb.Append(",\"IsSortable\":" + IsSortable.ToString().ToLower() + "");

            sb.Append("," + base.Json);

            return(sb.ToString());
        }
Example #13
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = Id.GetHashCode();
                hashCode = (hashCode * 397) ^ EntityRefId.GetHashCode();
                hashCode = (hashCode * 397) ^ (Employer != null ? Employer.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ ContactTypeId;
                hashCode = (hashCode * 397) ^ PreferredContactMethodType;
                hashCode = (hashCode * 397) ^ IsPrimary.GetHashCode();
                hashCode = (hashCode * 397) ^ (FirstName != null ? FirstName.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (MiddleName != null ? MiddleName.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (LastName != null ? LastName.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (JobTitle != null ? JobTitle.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (BusinessPhone != null ? BusinessPhone.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (MobilePhone != null ? MobilePhone.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (HomePhone != null ? HomePhone.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Email != null ? Email.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ CreatedOn.GetHashCode();
                hashCode = (hashCode * 397) ^ ModifiedOn.GetHashCode();

                return(hashCode);
            }
        }
Example #14
0
 /// <summary>
 /// Gets the string that represents the instance of this <see cref="DbField"/> object.
 /// </summary>
 /// <returns>The string that represents the instance of this <see cref="DbField"/> object.</returns>
 public override string ToString()
 {
     return(string.Concat(Name, ", ", IsPrimary.ToString(), " (", m_hashCode, ")"));
 }
Example #15
0
 /// <summary>
 /// Gets the string that represents the instance of this <see cref="DbField"/> object.
 /// </summary>
 /// <returns>The string that represents the instance of this <see cref="DbField"/> object.</returns>
 public override string ToString() =>
 string.Concat(Name, ", ", IsPrimary.ToString(), " (", hashCode, ")");
Example #16
0
        /// <summary>
        /// Returns true if AddressInfo instances are equal
        /// </summary>
        /// <param name="other">Instance of AddressInfo to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(AddressInfo other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     AddressId == other.AddressId ||
                     AddressId != null &&
                     AddressId.Equals(other.AddressId)
                     ) &&
                 (
                     Nickname == other.Nickname ||
                     Nickname != null &&
                     Nickname.Equals(other.Nickname)
                 ) &&
                 (
                     IsPrimary == other.IsPrimary ||
                     IsPrimary != null &&
                     IsPrimary.Equals(other.IsPrimary)
                 ) &&
                 (
                     CountryName == other.CountryName ||
                     CountryName != null &&
                     CountryName.Equals(other.CountryName)
                 ) &&
                 (
                     CountryId == other.CountryId ||
                     CountryId != null &&
                     CountryId.Equals(other.CountryId)
                 ) &&
                 (
                     Zip == other.Zip ||
                     Zip != null &&
                     Zip.Equals(other.Zip)
                 ) &&
                 (
                     City == other.City ||
                     City != null &&
                     City.Equals(other.City)
                 ) &&
                 (
                     AdministrativeArea == other.AdministrativeArea ||
                     AdministrativeArea != null &&
                     AdministrativeArea.Equals(other.AdministrativeArea)
                 ) &&
                 (
                     DependentLocality == other.DependentLocality ||
                     DependentLocality != null &&
                     DependentLocality.Equals(other.DependentLocality)
                 ) &&
                 (
                     SortingCode == other.SortingCode ||
                     SortingCode != null &&
                     SortingCode.Equals(other.SortingCode)
                 ) &&
                 (
                     Organization == other.Organization ||
                     Organization != null &&
                     Organization.Equals(other.Organization)
                 ) &&
                 (
                     AddressLine1 == other.AddressLine1 ||
                     AddressLine1 != null &&
                     AddressLine1.Equals(other.AddressLine1)
                 ) &&
                 (
                     AddressLine2 == other.AddressLine2 ||
                     AddressLine2 != null &&
                     AddressLine2.Equals(other.AddressLine2)
                 ));
        }
Example #17
0
 /// <summary>
 /// Indicates whether the current object is equal to another object of the same type.
 /// </summary>
 /// <param name="other">An object to compare with this object.</param>
 /// <returns>true if the current object is equal to the <paramref name="other" /> parameter; otherwise, false.</returns>
 public bool Equals(PointerPoint other)
 {
     return(EventType == other.EventType && DeviceType == other.DeviceType && PointerId == other.PointerId && Position.Equals(other.Position) && Timestamp == other.Timestamp && KeyModifiers == other.KeyModifiers && ContactRect.Equals(other.ContactRect) && IsBarrelButtonPressed.Equals(other.IsBarrelButtonPressed) && IsCanceled.Equals(other.IsCanceled) && IsEraser.Equals(other.IsEraser) && IsHorizontalMouseWheel.Equals(other.IsHorizontalMouseWheel) && IsInRange.Equals(other.IsInRange) && IsInverted.Equals(other.IsInverted) && IsLeftButtonPressed.Equals(other.IsLeftButtonPressed) && IsMiddleButtonPressed.Equals(other.IsMiddleButtonPressed) && IsRightButtonPressed.Equals(other.IsRightButtonPressed) && IsXButton1Pressed.Equals(other.IsXButton1Pressed) && IsXButton2Pressed.Equals(other.IsXButton2Pressed) && IsPrimary.Equals(other.IsPrimary) && MouseWheelDelta == other.MouseWheelDelta && Orientation.Equals(other.Orientation) && TouchConfidence.Equals(other.TouchConfidence) && Twist.Equals(other.Twist) && XTilt.Equals(other.XTilt) && YTilt.Equals(other.YTilt) && PointerUpdateKind == other.PointerUpdateKind);
 }