示例#1
0
 public bool Equals(Cmyk other)
 {
     return(Cyan.Equals(other.Cyan) &&
            Magenta.Equals(other.Magenta) &&
            Yellow.Equals(other.Yellow) &&
            Key.Equals(other.Key));
 }
        public override bool Equals(object obj)
        {
            if (!(obj is CmykColor))
            {
                return(false);
            }
            CmykColor c2 = (CmykColor)obj;

            return(Cyan.ApproxEquals(c2.Cyan) && Magenta.ApproxEquals(c2.Magenta) && Yellow.ApproxEquals(c2.Yellow) && Black.ApproxEquals(c2.Black));
        }
示例#3
0
 public override string ToString()
 {
     return(String.Format("C={0}, M={1}, Y={2}, K={3}", new string[]
     {
         Cyan.ToString(),
         Magenta.ToString(),
         Yellow.ToString(),
         Black.ToString(),
     }));
 }
示例#4
0
 public override int GetHashCode()
 {
     return(Cyan.GetHashCode() ^ Magenta.GetHashCode() ^ Yellow.GetHashCode() ^ Black.GetHashCode());
 }
示例#5
0
 /// <summary>
 /// Returns a System.String object that represents the current object.
 /// </summary>
 /// <returns>Text as a sequence of Unicode characters</returns>
 public override string ToString()
 {
     return(Cyan.ToString() + "\n" + Magenta.ToString() + "\n" + Yellow.ToString() + "\n" + Keycolor.ToString());
 }
示例#6
0
 /// <summary>
 /// Plays the role of a hash function of a certain type.
 /// </summary>
 /// <returns>Integer number</returns>
 public override int GetHashCode()
 {
     return(Cyan.GetHashCode() ^ Magenta.GetHashCode() ^ Yellow.GetHashCode() ^ Keycolor.GetHashCode());
 }