Exemplo n.º 1
0
    private void GenerateCells(int startSection, int startRow, int endSection, int endRow, bool backward = false)
    {
        if (backward)
        {
            startRow++;
        }
        else
        {
            startRow--;
        }

        Traverse traverse = tableSize.Next;

        if (backward)
        {
            traverse = tableSize.Prev;
        }

        while (traverse(ref startSection, ref startRow, endSection, endRow))
        {
            //Debug.LogFormat("Show ({0}, {1})", startSection, startRow);

            if (visibleCells.Count > 1)
            {
                if (Exceesing)
                {
                    return;
                }
            }
            

            if (startRow == -1)
            {
                // Header
                var header = datasource.GetSectionHeader(this, startSection);
                if (header != null)
                {
                    header.SetIndex(startSection, startRow);
                    AddCell(header, tableSize.Offset(startSection, startRow + 1), backward);
                }
            }
            else
            {
                var cell = datasource.GetCell(this, startSection, startRow);
                cell.SetIndex(startSection, startRow);
                AddCell(cell, tableSize.Offset(startSection, startRow + 1), backward);
            }
        }
    }