コード例 #1
0
 public override int GetHashCode()
 {
     return(0x1D11842C
            ^ (ProductName != null ? ProductName.GetHashCode() : 0)
            ^ (ComponentName != null ? ComponentName.GetHashCode() : 0)
            ^ (ComponentEdition != null ? ComponentEdition.GetHashCode() : 0)
            ^ (ComponentVersion != null ? ComponentVersion.GetHashCode() : 0)
            ^ (ComponentVersionSuffix != null ? ComponentVersionSuffix.GetHashCode() : 0)
            ^ (ComponentRelease != null ? ComponentRelease.GetHashCode() : 0));
 }
コード例 #2
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                int hash = 41;

                // Suitable nullity checks
                hash = hash * 59 + Id.GetHashCode();

                if (RentalAgreement != null)
                {
                    hash = hash * 59 + RentalAgreement.GetHashCode();
                }

                hash = hash * 59 + IsIncludedInTotal.GetHashCode();

                if (ComponentName != null)
                {
                    hash = hash * 59 + ComponentName.GetHashCode();
                }

                if (IsAttachment != null)
                {
                    hash = hash * 59 + IsAttachment.GetHashCode();
                }

                if (Rate != null)
                {
                    hash = hash * 59 + Rate.GetHashCode();
                }

                if (PercentOfEquipmentRate != null)
                {
                    hash = hash * 59 + PercentOfEquipmentRate.GetHashCode();
                }

                if (RatePeriod != null)
                {
                    hash = hash * 59 + RatePeriod.GetHashCode();
                }

                if (Comment != null)
                {
                    hash = hash * 59 + Comment.GetHashCode();
                }

                if (TimeRecords != null)
                {
                    hash = hash * 59 + TimeRecords.GetHashCode();
                }
                return(hash);
            }
        }
コード例 #3
0
 public override int GetHashCode() => ComponentName.GetHashCode() *(Major * 100000 + Minor * 1000 + Build * 100 + Revision);
コード例 #4
0
ファイル: ServerModule.cs プロジェクト: PokeD/PokeD.Server
 public override int GetHashCode() => ComponentName.GetHashCode();