/// <summary> /// Format the border /// </summary> /// <param name="p_Style"></param> /// <param name="p_width"></param> /// <param name="p_ShadowColor"></param> /// <param name="p_LightColor"></param> public static RectangleBorder FormatBorder(CommonBorderStyle p_Style, int p_width, Color p_ShadowColor, Color p_LightColor) { RectangleBorder l_Border = new RectangleBorder(new Border(Color.White));; if (p_Style == CommonBorderStyle.Inset) { l_Border.Top = new Border(p_ShadowColor, p_width); l_Border.Left = new Border(p_ShadowColor, p_width); l_Border.Bottom = new Border(p_LightColor, p_width); l_Border.Right = new Border(p_LightColor, p_width); } else if (p_Style == CommonBorderStyle.Raised) { l_Border.Top = new Border(p_LightColor, p_width); l_Border.Left = new Border(p_LightColor, p_width); l_Border.Bottom = new Border(p_ShadowColor, p_width); l_Border.Right = new Border(p_ShadowColor, p_width); } else { l_Border.Top = new Border(p_ShadowColor, p_width); l_Border.Left = new Border(p_ShadowColor, p_width); l_Border.Bottom = new Border(p_ShadowColor, p_width); l_Border.Right = new Border(p_ShadowColor, p_width); } return(l_Border); }
/// <summary> /// Compare to current border with another border. /// </summary> /// <param name="obj"></param> /// <returns></returns> public override bool Equals(object obj) { if (obj == null) { return(false); } if (obj.GetType() != GetType()) { return(false); } RectangleBorder l_Other = (RectangleBorder)obj; if (l_Other.Left == Left && l_Other.Bottom == Bottom && l_Other.Top == Top && l_Other.Right == Right) { return(true); } else { return(false); } }