/// <summary> /// Creates a new table, and adds it to the GHTActivesubTest. /// </summary> /// <param name="ctrlType">The type of the ctrl to test. must be one of </param> /// <param name="description"></param> /// <returns></returns> protected Control GetTableRelated(Type ctrlType, bool a_AddToPage) { Table l_table = new Table(); TableRow l_headerRow = new TableRow(); TableRow l_row = new TableRow(); TableCell l_cell = new TableCell(); TableHeaderCell l_headerCell = new TableHeaderCell(); if (a_AddToPage) { GHTActiveSubTest.Controls.Add(l_table); } l_table.Rows.Add(l_headerRow); l_table.Rows.Add(l_row); l_headerRow.Cells.Add(l_headerCell); l_row.Cells.Add(l_cell); l_headerCell.Text = "Header cell"; l_cell.Text = "Table cell"; if ( l_table.GetType() == ctrlType) { return l_table; } else if (l_row.GetType() == ctrlType) { return l_row; } else if (l_cell.GetType() == ctrlType) { return l_cell; } else if(l_headerCell.GetType() == ctrlType) { return l_headerCell; } else { throw new ArgumentException("Should be table related type.", "ctrlType = " + ctrlType.ToString() ); } }