Exemplo n.º 1
0
        } // IsEqual

        private int ComputeHashCode()
        {
            var hash = ForegroundColor.GetHashCode();

            hash = HashTool.AddHashCode(hash, BackgroundColor);
            hash = HashTool.AddHashCode(hash, FontFamily);
            hash = HashTool.AddHashCode(hash, FontSize);
            return(hash);
        } // ComputeHashCode
Exemplo n.º 2
0
        /// <summary>
        /// Returns a hash code for this instance.
        /// </summary>
        /// <returns>
        /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
        /// </returns>
        public override int GetHashCode()
        {
            unchecked
            {
                int hash = 17;
                hash = hash * 23 + Char.GetHashCode();
                hash = hash * 23 + ForegroundColor.GetHashCode();
                hash = hash * 23 + BackgroundColor.GetHashCode();

                return(hash);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Computes the hash code for this object.
 /// </summary>
 /// <returns>The hash code.</returns>
 public override int GetHashCode()
 {
     // Overflow is fine, just wrap
     unchecked
     {
         var hash = 17;
         hash = (hash * 23) + Content.GetHashCode();
         hash = (hash * 23) + ForegroundColor.GetHashCode();
         hash = (hash * 23) + BackgroundColor.GetHashCode();
         return(hash);
     }
 }
Exemplo n.º 4
0
        public override int GetHashCode()
        {
            int hash = Text?.GetHashCode() ?? -1;

            hash ^= BackgroundColor.GetHashCode();
            hash ^= ForegroundColor.GetHashCode();
            hash ^= FontAttributes.GetHashCode();
            hash ^= FontSize.GetHashCode();
            hash ^= Command?.GetHashCode() ?? -1;
            hash ^= CommandParameter?.GetHashCode() ?? -1;
            return(hash);
        }
Exemplo n.º 5
0
        public override int GetHashCode()
        {
            unchecked
            {
                int hash = 17;

                hash = hash * 23 + PatternType.GetHashCode();
                hash = hash * 23 + ForegroundColor?.GetHashCode() ?? 0;
                hash = hash * 23 + BackgroundColor?.GetHashCode() ?? 0;

                return(hash);
            }
        }
Exemplo n.º 6
0
        public override int GetHashCode()
        {
            int hash = base.GetHashCode();

            hash ^= ForegroundColor.GetHashCode();
            hash ^= BackgroundColor.GetHashCode();
            hash ^= Underline.GetHashCode();
            hash ^= Bold.GetHashCode();
            hash ^= Italic.GetHashCode();
            if (Text != null)
            {
                hash ^= Text.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 7
0
 public override int GetHashCode()
 {
     return(Character.GetHashCode()
            + ForegroundColor.GetHashCode()
            + BackgroundColor.GetHashCode());
 }
Exemplo n.º 8
0
 public override int GetHashCode()
 {
     return(Char.GetHashCode()
            ^ ForegroundColor.GetHashCode()
            ^ BackGroundColor.GetHashCode());
 }
Exemplo n.º 9
0
 // override object.GetHashCode
 public override int GetHashCode()
 {
     return(Object.GetHashCode() + BackgroundColor.GetHashCode() + ForegroundColor.GetHashCode());
 }