Пример #1
0
 private void AddDefaultColumns(DataTableBuilder builder, DataTable jsonDataTable)
 {
     foreach (DataColumn i in jsonDataTable.Columns)
     {
         builder.AddColumn(new DataColumnDefinition(i.ColumnName, i.DataType));
     }
 }
        private void AddDefaultColumns(IWebElement element, DataTableBuilder builder)
        {
            var thElements = element.FindElements(By.CssSelector("th"));

            if (!thElements.Any())
            {
                throw new ArgumentException("No columns found.  Make sure the table contains a <tr> with at least one <th> in it, or manually specify the columns by passing in ColumnDefinitions.");
            }

            var columns = new List <DataColumnDefinition>();

            foreach (var i in thElements)
            {
                builder.AddColumn(new DataColumnDefinition(i.Text, typeof(string)));
            }
        }