示例#1
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Color != null)
         {
             hashCode = hashCode * 59 + Color.GetHashCode();
         }
         if (Opacity != null)
         {
             hashCode = hashCode * 59 + Opacity.GetHashCode();
         }
         if (Blend != null)
         {
             hashCode = hashCode * 59 + Blend.GetHashCode();
         }
         if (SizeMin != null)
         {
             hashCode = hashCode * 59 + SizeMin.GetHashCode();
         }
         if (SizeMax != null)
         {
             hashCode = hashCode * 59 + SizeMax.GetHashCode();
         }
         if (Border != null)
         {
             hashCode = hashCode * 59 + Border.GetHashCode();
         }
         return(hashCode);
     }
 }
示例#2
0
        /// <inheritdoc />
        public bool Equals([AllowNull] Marker other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Color == other.Color ||
                     Color != null &&
                     Color.Equals(other.Color)
                     ) &&
                 (
                     Opacity == other.Opacity ||
                     Opacity != null &&
                     Opacity.Equals(other.Opacity)
                 ) &&
                 (
                     Blend == other.Blend ||
                     Blend != null &&
                     Blend.Equals(other.Blend)
                 ) &&
                 (
                     SizeMin == other.SizeMin ||
                     SizeMin != null &&
                     SizeMin.Equals(other.SizeMin)
                 ) &&
                 (
                     SizeMax == other.SizeMax ||
                     SizeMax != null &&
                     SizeMax.Equals(other.SizeMax)
                 ) &&
                 (
                     Border == other.Border ||
                     Border != null &&
                     Border.Equals(other.Border)
                 ));
        }
        /// <summary>
        /// Create a human-readable string of the object.
        /// </summary>
        /// <returns>String.</returns>
        public override string ToString()
        {
            string ret = "";

            ret += "---" + Environment.NewLine;
            ret += "  Prefix       : " + (String.IsNullOrEmpty(Prefix) ? "null" : Prefix) + Environment.NewLine;
            ret += "  Md5          : " + (String.IsNullOrEmpty(Md5) ? "null" : Md5) + Environment.NewLine;
            ret += "  Content Type : " + (String.IsNullOrEmpty(ContentType) ? "null" : ContentType) + Environment.NewLine;
            ret += "  Created" + Environment.NewLine;
            ret += "    Before     : " + (CreatedBefore == null ? "null" : CreatedBefore.Value.ToString()) + Environment.NewLine;
            ret += "    After      : " + (CreatedAfter == null ? "null" : CreatedAfter.Value.ToString()) + Environment.NewLine;
            ret += "  Updated" + Environment.NewLine;
            ret += "    Before     : " + (UpdatedBefore == null ? "null" : UpdatedBefore.Value.ToString()) + Environment.NewLine;
            ret += "    After      : " + (UpdatedAfter == null ? "null" : UpdatedAfter.Value.ToString()) + Environment.NewLine;
            ret += "  Last Access" + Environment.NewLine;
            ret += "    Before     : " + (LastAccessBefore == null ? "null" : LastAccessBefore.Value.ToString()) + Environment.NewLine;
            ret += "    After      : " + (LastAccessAfter == null ? "null" : LastAccessAfter.Value.ToString()) + Environment.NewLine;
            ret += "  Size         " + Environment.NewLine;
            ret += "    Min        : " + (SizeMin == null ? "null" : SizeMin.ToString()) + Environment.NewLine;
            ret += "    After      : " + (SizeMax == null ? "null" : SizeMax.ToString()) + Environment.NewLine;
            ret += "  Tags         : " + ((Tags == null || Tags.Count < 1) ? "null" : Tags.Count.ToString() + " tags") + Environment.NewLine;

            if (Tags != null && Tags.Count > 0)
            {
                foreach (string curr in Tags)
                {
                    Console.WriteLine("    " + curr + Environment.NewLine);
                }
            }

            ret += "  Key Values   : " + ((KeyValuePairs == null || KeyValuePairs.Count < 1) ? "null" : KeyValuePairs.Count + " pairs") + Environment.NewLine;

            if (KeyValuePairs != null && KeyValuePairs.Count > 0)
            {
                foreach (KeyValuePair <string, string> curr in KeyValuePairs)
                {
                    Console.WriteLine("    " + curr.Key + " = " + curr.Value + Environment.NewLine);
                }
            }

            return(ret);
        }