public CsvValue this[int columnIndex, int rowIndex] { get { if (columnIndex < 0 || columnIndex >= this.ColumnLength) { CsvGeneric.IndexOutOfException(columnIndex, rowIndex); return(new CsvValue()); } if (rowIndex < 0 || rowIndex >= this.RowLength) { CsvGeneric.IndexOutOfException(columnIndex, rowIndex); return(new CsvValue()); } return(this._value[columnIndex].value[rowIndex]); } set { if (columnIndex < 0 || columnIndex >= this.ColumnLength) { CsvGeneric.IndexOutOfException(columnIndex, rowIndex); return; } if (rowIndex < 0 || rowIndex >= this.RowLength) { CsvGeneric.IndexOutOfException(columnIndex, rowIndex); return; } this._value[columnIndex].value[rowIndex] = value; } }
public void SetKey(int index, string key) { if (index < 0 || index >= this._key.Length) { CsvGeneric.IndexOutOfException(index, false); return; } this._key[index] = key; }
public string GetKey(int index) { if (index < 0 || index >= this._key.Length) { CsvGeneric.IndexOutOfException(index, false); return(null); } return(this._key[index]); }
public void RemoveAt(int index) { if (this._raw.Count >= index || index < 0) { CsvGeneric.IndexOutOfException(index, false); return; } this._raw.RemoveAt(index); }
public CsvRow GetRow(int rowIndex) { if (rowIndex < 0 || rowIndex >= this.RowLength) { CsvGeneric.IndexOutOfException(rowIndex, true); return(null); } return(new CsvRow(this._key.ToArray(), this.GetRowList(rowIndex).ToArray())); }
public void RemoveAtColumn(int columnIndex) { if (columnIndex >= this.ColumnLength || columnIndex < 0) { CsvGeneric.IndexOutOfException(columnIndex, false); return; } this._value.RemoveAt(columnIndex); }
public CsvColumn GetColumn(int columnIndex) { if (columnIndex < 0 || columnIndex >= this.ColumnLength) { CsvGeneric.IndexOutOfException(columnIndex, false); return(null); } return(new CsvColumn(this._key[columnIndex], this.GetColumnList(columnIndex).ToArray())); }
public void SetRow(int rowIndex, CsvRow csvRow) { if (this.RowLength <= rowIndex || rowIndex < 0) { CsvGeneric.IndexOutOfException(rowIndex, true); return; } for (int i = 0; i < this.ColumnLength; i++) { this[i, rowIndex] = csvRow[i]; } }
public void RemoveAtRow(int rowIndex) { for (int i = 0; i < this.ColumnLength; i++) { if (this.RowLength <= rowIndex || rowIndex < 0) { CsvGeneric.IndexOutOfException(rowIndex, true); return; } this._value[i].value.RemoveAt(rowIndex); } this._rowLengthCache--; }
public void InsertRaw(int rowIndex, CsvRow csvRow) { if (this.RowLength < rowIndex || rowIndex < 0) { CsvGeneric.IndexOutOfException(rowIndex, true); return; } if (rowIndex == this.RowLength) { this.AddRow(csvRow); return; } for (int i = 0; i < this.ColumnLength; i++) { this._value[i].value.Insert(rowIndex, new CsvValue()); this[csvRow.GetKey(i), rowIndex] = csvRow[i]; } }
public CsvValue this[int columnIndex] { get { if (columnIndex < 0 || columnIndex >= this._key.Length) { CsvGeneric.IndexOutOfException(columnIndex, false); return(null); } return(this._column[columnIndex]); } set { if (columnIndex < 0 || columnIndex >= this._key.Length) { CsvGeneric.IndexOutOfException(columnIndex, false); return; } this._column[columnIndex] = value; } }
public CsvValue this[int row] { get { if (row < 0 || row >= this.Length) { CsvGeneric.IndexOutOfException(row, true); return(new CsvValue()); } return(this._raw[row]); } set { if (row < 0 || row >= this.Length) { CsvGeneric.IndexOutOfException(row, true); return; } this._raw[row] = value; } }
public void InsertColumn(int columnIndex, CsvColumn csvColumn) { if (columnIndex < 0 || columnIndex > this.ColumnLength) { CsvGeneric.IndexOutOfException(columnIndex, false); return; } List <CsvValue> list = this.CsvColumnToList(csvColumn); if (this.RowLength != list.Count) { while (this.RowLength != list.Count) { if (this.RowLength > list.Count) { list.Add(new CsvValue()); } else { this.AddRow(); } } } CsvColumnList csvColumnList = new CsvColumnList(); csvColumnList.value = this.CsvColumnToList(csvColumn); if (!this.ContainsColumn(csvColumn, false)) { this._key.Insert(columnIndex, csvColumn.key); this._value.Insert(columnIndex, csvColumnList); } else { this._key.Add(csvColumn.key); this._value.Add(csvColumnList); } }