public override bool Equals(object obj) { if (obj == null) { return(false); } if (obj == this) { return(true); } if (!(obj is StateStyle)) { return(false); } StateStyle targetStyle = ( StateStyle )obj; if (targetStyle.BackColor == this.BackColor && targetStyle.ForeColor == this.ForeColor && targetStyle.BorderColor == this.BorderColor) { return(true); } return(false); }
static CommonControlStyle() { _normalStyle = new StateStyle() { BackColor = Color.White, ForeColor = Color.Black, BorderColor = Color.Gray }; _hoverStyle = new StateStyle() { BackColor = Color.White, ForeColor = Color.Black, BorderColor = Color.Gray }; _disabledStyle = new StateStyle() { BackColor = Color.White, ForeColor = Color.Black, BorderColor = Color.Gray }; }