コード例 #1
0
 public static bool CompareTo(ColorRect c1, ColorRect c2)
 {
     if (c1 == null && c2 == null)
     {
         return(true);
     }
     if (c1 == null || c2 == null)
     {
         return(false);
     }
     for (int i = 0; i < 4; i++)
     {
         ColorEx color1 = c1.colors[i];
         ColorEx color2 = c2.colors[i];
         if (color1 == null && color2 == null)
         {
             continue;
         }
         if (color1 == null || color2 == null)
         {
             return(false);
         }
         if (color1.CompareTo(color2) != 0)
         {
             return(false);
         }
     }
     return(true);
 }
コード例 #2
0
        public override bool Equals(object other)
        {
            if (!(other is TextStyle))
            {
                return(false);
            }
            TextStyle otherStyle = other as TextStyle;

            if (shadowEnabled != otherStyle.shadowEnabled ||
                bgEnabled != otherStyle.bgEnabled)
            {
                return(false);
            }
            if (textColor.CompareTo(otherStyle.textColor) != 0)
            {
                return(false);
            }
            if (bgEnabled &&
                bgColor.CompareTo(otherStyle.bgColor) != 0)
            {
                return(false);
            }
            if (shadowEnabled &&
                shadowColor.CompareTo(otherStyle.shadowColor) != 0)
            {
                return(false);
            }
            return(true);
        }