public SpreadMatrixDataCell GetDataCell(MDDatePair datePair) { lock (LockObject) { SecurityEntry entry = spreadMatrixEntries.GetValue(datePair.GetMinDate(), datePair.GetMaxDate()); if (entry != null) { SpreadMatrixDataCell cell = new SpreadMatrixDataCell(); cell.FillData(entry); return cell; } return null; } }
void SetMaxYearMonth(MDDatePair datePair) { if (maxYearMonth == new DateTime()) maxYearMonth = datePair.GetMaxDate(); else maxYearMonth = MDDatePair.GetMaxDate(maxYearMonth, datePair.GetMaxDate()); }
public MDDatePair GetDatePair() { switch (SubContractCount) { case 0: return new MDDatePair(MaturityMonthYear, MaturityMonthYear); case 1: return new MDDatePair(GetSubContract(0).MaturityMonthYear, GetSubContract(0).MaturityMonthYear); case 2: MDDatePair datePair = new MDDatePair(GetSubContract(0).MaturityMonthYear, GetSubContract(1).MaturityMonthYear); return new MDDatePair(datePair.GetMinDate(), datePair.GetMaxDate()); } throw new Exception("Contracts that contains more than 2 subcontracts detected. These contracts currently not supported."); }