public override bool Equals(System.Object obj) { if (obj == null) { return(false); } ScheduledDateTime a = obj as ScheduledDateTime; if ((System.Object)a == null) { return(false); } bool equals = true; if (a.hour != -1 && hour != -1) { equals &= a.hour == hour; } if (a.minute != -1 && minute != -1) { equals &= a.minute == minute; } if (a.dayofweek != -1 && dayofweek != -1) { equals &= a.dayofweek == dayofweek; } if (a.dayofmonth != -1 && dayofmonth != -1) { equals &= a.dayofmonth == dayofmonth; } if (a.month != -1 && month != -1) { equals &= a.month == month; } return(equals); }