コード例 #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 (Uuid != null)
         {
             hashCode = hashCode * 59 + Uuid.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (Value1 != null)
         {
             hashCode = hashCode * 59 + Value1.GetHashCode();
         }
         if (Value2 != null)
         {
             hashCode = hashCode * 59 + Value2.GetHashCode();
         }
         if (Value3 != null)
         {
             hashCode = hashCode * 59 + Value3.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Code;
         hashCode = (hashCode * 397) ^ (Value1 != null ? Value1.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Value2 != null ? Value2.GetHashCode() : 0);
         return(hashCode);
     }
 }
コード例 #3
0
ファイル: ColumnPredicate.cs プロジェクト: brhinescot/Loom
 /// <summary>
 /// Serves as a hash function for a particular type.
 /// </summary>
 /// <returns>
 /// A hash code for the current <see cref="T:System.Object" />.
 /// </returns>
 /// <filterpriority>2</filterpriority>
 public override int GetHashCode()
 {
     unchecked
     {
         int result = (Column != null ? Column.GetHashCode() : 0);
         result = (result * 397) ^ (Value != null ? Value.GetHashCode() : 0);
         result = (result * 397) ^ (Value2 != null ? Value2.GetHashCode() : 0);
         result = (result * 397) ^ Comparison.GetHashCode();
         result = (result * 397) ^ (NextInGroup != null ? NextInGroup.GetHashCode() : 0);
         result = (result * 397) ^ OrNextPredicate.GetHashCode();
         result = (result * 397) ^ OrToPreviousGroup.GetHashCode();
         return(result);
     }
 }
コード例 #4
0
        public override int GetHashCode()
        {
            unchecked
            {
                if (Operator.IsRangeOperator())
                {
                    return(Value.GetHashCode() + Value2.GetHashCode() + Operator.GetHashCode());
                }

                if (Operator != QueryOperator.In && Operator != QueryOperator.NotIn)
                {
                    return(Value.GetHashCode() + Operator.GetHashCode());
                }

                var sum = 0;
                foreach (var value in InValues)
                {
                    sum += value.GetHashCode();
                }

                return(Operator.GetHashCode() + sum);
            }
        }
コード例 #5
0
 // this isn't exactly identical to the netcore algorithm, but good enough
 public override int GetHashCode() => (Value1?.GetHashCode() ?? 0) ^ (Value2?.GetHashCode() ?? 0 << 3);
コード例 #6
0
ファイル: SemanticType2.cs プロジェクト: x3lor/WPF-Example
 public override int    GetHashCode() => Value1.GetHashCode() ^ Value2.GetHashCode();
コード例 #7
0
 public override int GetHashCode()
 {
     return(Value1.GetHashCode() ^ Value2.GetHashCode() ^ Weight.GetHashCode());
 }
コード例 #8
0
 public override int GetHashCode()
 {
     return(Value1.GetHashCode() + Value2.GetHashCode() + Value3.GetHashCode());
 }
コード例 #9
0
 public override Int32 GetHashCode() => Timestamp.GetHashCode() ^ Value1.GetHashCode() ^ Value2.GetHashCode() ^ Value3.GetHashCode();