Beispiel #1
0
    private void InserBottomCells()
    {
        int startSection = visibleCells.Last.Value.Section, startRow = visibleCells.Last.Value.Row;
        int endSection = 0, endRow = 0;

        if (!tableSize.RowAt(BottomOffset, ref endSection, ref endRow))
        {
            endSection = tableSize.SectionCount - 1;
            endRow     = tableSize.LastSection.RowCount - 1;
        }

        if (TableSize.IndexCompare(startSection, startRow, endSection, endRow) < 0)
        {
            ////Debug.LogFormat("Insert bottom ({0}, {1}) -> ({2}, {3})", startSection, startRow, endSection, endRow);
            tableSize.Next(ref startSection, ref startRow, endSection, endRow);
            GenerateCells(startSection, startRow, endSection, endRow);
        }
    }
Beispiel #2
0
    private void InsertTopCells()
    {
        int startSection = 0, startRow = 0;
        int endSection = visibleCells.First.Value.Section, endRow = visibleCells.First.Value.Row;

        if (!tableSize.RowAt(TopOffset, ref startSection, ref startRow))
        {
            startSection = 0;
            startRow     = -1;
        }

        if (TableSize.IndexCompare(startSection, startRow, endSection, endRow) < 0)
        {
            ////Debug.LogFormat("Insert top ({0}, {1}) -> ({2}, {3})", startSection, startRow, endSection, endRow);
            tableSize.Prev(ref endSection, ref endRow, startSection, startRow);
            GenerateCells(endSection, endRow, startSection, startRow, true);
        }
    }
Beispiel #3
0
    private void RemoveBottomInvisible()
    {
        if (visibleCells.Count == 0)
        {
            return;
        }

        int section = 0, row = 0;

        if (tableSize.RowAt(BottomOffset, ref section, ref row))
        {
            while (visibleCells.Count > 0 && TableSize.IndexCompare(section, row, visibleCells.Last.Value.Section, visibleCells.Last.Value.Row) < 0)
            {
                //Debug.LogFormat("Remove invisible cell ({0}, {1})", visibleCells.Last.Value.Section, visibleCells.Last.Value.Row);
                Cache(visibleCells.Last.Value);
                visibleCells.RemoveLast();
            }
        }
    }