private void GetTable(int agencyNumber, int thisCategory) { if (!InflationTables.ContainsKey(agencyNumber)) //if the table is not yet in the dictionary, retrieve it { InflationTable newTable = new InflationTable(); InflationTables.Add(agencyNumber, newTable); if (!newTable.SetAgency(agencyNumber)) //If this fails, kill GetTable() { return; } InflationTables[agencyNumber].UpdateTable(); } }
public static dynamic INFL(int fromYear, int toYear, int mode, int category, int agency = 4) { if (inflCalc == null) { inflCalc = new InflationCalculator(); } if (inflTable == null) { inflTable = new InflationTable(); inflTable.SetAgency(4); inflTable.UpdateTable(); } try { return(inflCalc.Calculate(fromYear, toYear, mode, category, agency)); } catch { return(ExcelError.ExcelErrorValue); } }