public int CompareTo(object obj) { SpanOfMonths other = obj as SpanOfMonths; if (this.PeriodFrom.Equals(other.PeriodFrom)) { return(this.PeriodUpto.CompareTo(other.PeriodUpto)); } return(this.PeriodFrom.CompareTo(other.PeriodFrom)); }
public override bool Equals(object obj) { if (obj == this) { return(true); } if (obj == null || this.GetType() != obj.GetType()) { return(false); } SpanOfMonths other = obj as SpanOfMonths; return(this.isEqualToInterval(other)); }
public bool isEqualToInterval(SpanOfMonths other) { return(this.PeriodFrom.Equals(other.PeriodFrom) && this.PeriodUpto.Equals(other.PeriodUpto)); }