Esempio n. 1
0
 internal CsvRowHeaders(CsvRow.CsvRowMetadata metadata)
 {
     if (metadata == null)
     {
         throw new ArgumentNullException("metadata");
     }
     if (metadata._row._headers == null)
     {
         throw new ArgumentException("No headers present.", "metadata");
     }
     this._metadata = metadata;
 }
Esempio n. 2
0
 public CsvRow(string[] data, string delimiter = ";", IDictionary <string, int> headers = null, uint?lineNumber = null)
 {
     if (data == null)
     {
         throw new ArgumentNullException("data");
     }
     if (headers != null && headers.Count > 0 && (int)data.Length != headers.Count)
     {
         throw new ArgumentException(string.Format("Row{0} has {1} columns but we expected {2} columns (equal to number of header columns).", (lineNumber.HasValue ? string.Concat(" #", lineNumber.Value) : string.Empty), (int)data.Length, headers.Count));
     }
     this._data    = data;
     this._headers = headers;
     this.Meta     = new CsvRow.CsvRowMetadata(this, delimiter, lineNumber);
 }