public void AddName(NameRecord name) { _definedNames.Add(name); // TODO - this Is messy // Not the most efficient way but the other way was causing too many bugs int idx = FindFirstRecordLocBySid(ExternSheetRecord.sid); if (idx == -1) { idx = FindFirstRecordLocBySid(SupBookRecord.sid); } if (idx == -1) { idx = FindFirstRecordLocBySid(CountryRecord.sid); } int countNames = _definedNames.Count; _workbookRecordList.Add(idx + countNames, name); }
public LinkTable(int numberOfSheets, WorkbookRecordList workbookRecordList) { _workbookRecordList = workbookRecordList; _definedNames = new List <NameRecord>(); _externalBookBlocks = new ExternalBookBlock[] { new ExternalBookBlock(numberOfSheets), }; _externSheetRecord = new ExternSheetRecord(); _recordCount = 2; // tell _workbookRecordList about the 2 new records SupBookRecord supbook = _externalBookBlocks[0].GetExternalBookRecord(); int idx = FindFirstRecordLocBySid(CountryRecord.sid); if (idx < 0) { throw new Exception("CountryRecord not found"); } _workbookRecordList.Add(idx + 1, _externSheetRecord); _workbookRecordList.Add(idx + 1, supbook); }
public LinkTable(int numberOfSheets, WorkbookRecordList workbookRecordList) { _workbookRecordList = workbookRecordList; _definedNames = new List<NameRecord>(); _externalBookBlocks = new ExternalBookBlock[] { new ExternalBookBlock(numberOfSheets), }; _externSheetRecord = new ExternSheetRecord(); _recordCount = 2; // tell _workbookRecordList about the 2 new records SupBookRecord supbook = _externalBookBlocks[0].GetExternalBookRecord(); int idx = FindFirstRecordLocBySid(CountryRecord.sid); if (idx < 0) { throw new Exception("CountryRecord not found"); } _workbookRecordList.Add(idx + 1, _externSheetRecord); _workbookRecordList.Add(idx + 1, supbook); }