Пример #1
0
 public bool Equals(Cmyk other)
 {
     return(Cyan.Equals(other.Cyan) &&
            Magenta.Equals(other.Magenta) &&
            Yellow.Equals(other.Yellow) &&
            Key.Equals(other.Key));
 }
Пример #2
0
        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());
 }