ApiExamples.ExTable.GetChildTableCount C# (CSharp) Метод

GetChildTableCount() приватный статический Метод

Determines if a table contains any immediate child table within its cells. Does not recursively traverse through those tables to check for further tables. Returns true if at least one child cell contains a table. Returns false if no cells in the table contains a table.
private static GetChildTableCount ( Table table ) : int
table Table
Результат int
        private static int GetChildTableCount(Table table)
        {
            int tableCount = 0;
            // Iterate through all child rows in the table
            foreach (Row row in table.Rows)
            {
                // Iterate through all child cells in the row
                foreach (Cell Cell in row.Cells)
                {
                    // Retrieve the collection of child tables of this cell
                    TableCollection childTables = Cell.Tables;

                    // If this cell has a table as a child then return true
                    if (childTables.Count > 0)
                        tableCount++;
                }
            }

            // No cell contains a table
            return tableCount;
        }
        //ExEnd