/// <summary> /// Construct a DataBlock with a given set of column names and /// the pre-built arrays for each row. [NOT EFFICIENT] /// </summary> /// <param name="columnNames">Names of columns in block</param> /// <param name="rowCount">Number of rows in block</param> public DataBlock(IEnumerable <string> columnNames, Array rows) : this(ColumnDetails.FromNames(columnNames), (rows == null ? 0 : rows.GetLength(0))) { if (rows == null) { throw new ArgumentNullException("rows"); } for (int i = 0; i < this.RowCount; ++i) { Array rowArray = (Array)rows.GetValue(i); if (rowArray == null) { throw new ArgumentNullException(String.Format("rows[{0}]", i)); } this.SetRow(i, rowArray); } }
/// <summary> /// Construct a DataBlock with a given set of column names and /// the pre-built arrays for each column [allowing strongly typed columns]. /// </summary> /// <param name="columnNames">Names of columns in block</param> /// <param name="columns">System.Array containing a System.Array per column</param> public DataBlock(IEnumerable <string> columnNames, int rowCount, Array columns) : this(ColumnDetails.FromNames(columnNames), rowCount, columns) { }