using System; using System.Collections.Generic; using System.Text; using System.Collections; namespace Biff8Excel.Excel { /// /// 所有有内容ExcelCellLink的链 /// key 为行号 从零开始 /// public class ExcelRowLinkDictionary : SortedList //BaseTwoLinkList { ExcelCellLinkDictionary arrCells; //ushort m_sheetNumber; //ushort m_rowNumber; ExcelWorkbook pWorkbook; public ExcelRowLinkDictionary(ExcelWorkbook pWorkbook) : base() { this.pWorkbook = pWorkbook; } /// /// 为指定单元格赋值 /// /// 行 /// 列 /// 单元格的实例 public void AddCell(ushort iRow, ushort iColumn, ExcelCell oCell) { //TwoLinkNode tp; //nodeLocation nl = FindByIndex(iRow, out tp); //if (nl != nodeLocation.current) //{ // arrCells = new ExcelCellLink(pWorkbook); // arrCells.sheetNumber = sheetnumber; // arrCells.rowNumber = iRow; // base.Insert(iRow, arrCells, nl); //} //current.Data.Insert(iColumn, oCell); if (this.TryGetValue(iRow, out arrCells)) { arrCells.SetCell(iColumn, oCell); } else { arrCells = new ExcelCellLinkDictionary(pWorkbook); //arrCells.sheetNumber = sheetnumber; arrCells.rowNumber = iRow; arrCells.AddCell(iColumn, oCell); this.Add(iRow, arrCells); } } internal ushort LastUsedRow { get { return this.Keys[this.Count - 1]; } //get { return this.tail.Index; } } //internal ushort sheetNumber //{ // set { m_sheetNumber = value; } //} } }