Ejemplo n.º 1
0
 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;
     }
 }
Ejemplo n.º 2
0
 public void SetKey(int index, string key)
 {
     if (index < 0 || index >= this._key.Length)
     {
         CsvGeneric.IndexOutOfException(index, false);
         return;
     }
     this._key[index] = key;
 }
Ejemplo n.º 3
0
 public string GetKey(int index)
 {
     if (index < 0 || index >= this._key.Length)
     {
         CsvGeneric.IndexOutOfException(index, false);
         return(null);
     }
     return(this._key[index]);
 }
Ejemplo n.º 4
0
 public void RemoveAt(int index)
 {
     if (this._raw.Count >= index || index < 0)
     {
         CsvGeneric.IndexOutOfException(index, false);
         return;
     }
     this._raw.RemoveAt(index);
 }
Ejemplo n.º 5
0
 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()));
 }
Ejemplo n.º 6
0
 public void RemoveAtColumn(int columnIndex)
 {
     if (columnIndex >= this.ColumnLength || columnIndex < 0)
     {
         CsvGeneric.IndexOutOfException(columnIndex, false);
         return;
     }
     this._value.RemoveAt(columnIndex);
 }
Ejemplo n.º 7
0
 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()));
 }
Ejemplo n.º 8
0
 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];
     }
 }
Ejemplo n.º 9
0
 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--;
 }
Ejemplo n.º 10
0
 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];
     }
 }
Ejemplo n.º 11
0
 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;
     }
 }
Ejemplo n.º 12
0
 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;
     }
 }
Ejemplo n.º 13
0
        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);
            }
        }