public int CompareTo(CifCalendar other) { if (ReferenceEquals(null, other)) { return(-1); } var compare = RunsFrom.CompareTo(other.RunsFrom); if (compare != 0) { return(compare); } compare = RunsTo.CompareTo(other.RunsTo); if (compare != 0) { return(compare); } compare = DayMask.CompareTo(other.DayMask); if (compare != 0) { return(compare); } return(BankHolidays.CompareTo(other.BankHolidays)); }
public override int GetHashCode() { unchecked { var hashCode = RunsFrom.GetHashCode(); hashCode = (hashCode * 397) ^ RunsTo.GetHashCode(); hashCode = (hashCode * 397) ^ (int)DayMask; hashCode = (hashCode * 397) ^ (int)BankHolidays; return(hashCode); } }
public bool Equals(CifCalendar other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(RunsFrom.Equals(other.RunsFrom) && RunsTo.Equals(other.RunsTo) && DayMask == other.DayMask && BankHolidays == other.BankHolidays); }
public override string ToString() { return(BankHolidays == BankHolidayRunning.RunsOnBankHoliday ? $"{RunsFrom.ToYMD()}=>{RunsTo.ToYMD()} {DayMask.ToStringEx()}" : $"{RunsFrom.ToYMD()}=>{RunsTo.ToYMD()} {DayMask.ToStringEx()} ({BankHolidays.ToStringEx()})"); }