예제 #1
0
 public void FillPersistentData()
 {
     for (int i = 0; i < rowCount; i++)
     {
         object[] rowData = GetRowData(i);
         DataRow2 row     = persistentTable.NewRow();
         for (int j = 0; j < persistentColInds.Count; j++)
         {
             row[j] = rowData[persistentColInds[j]];
         }
         persistentTable.AddRow(row);
     }
 }
예제 #2
0
        private int GetIntValue(DataRow2 row, int colInd)
        {
            bool   isInt = columnTypes[colInd] == ColumnType.Integer;
            object o     = row[colInd];

            if (isInt)
            {
                if (o == null || o is DBNull || o.ToString().Length == 0)
                {
                    return(0);
                }
                return((int)o);
            }
            return(0);
        }
예제 #3
0
        private double GetDoubleValue(DataRow2 row, int colInd)
        {
            bool   isInt    = columnTypes[colInd] == ColumnType.Integer;
            bool   isDouble = IsNumeric(colInd);
            object o        = row[colInd];

            if (isInt || isDouble)
            {
                if (o == null || o is DBNull || o.ToString().Length == 0)
                {
                    return(double.NaN);
                }
                if (isInt)
                {
                    return((int)o);
                }
                return((double)o);
            }
            return(double.NaN);
        }
예제 #4
0
 public void RemoveRow(DataRow2 row)
 {
     Rows.Remove(row);
 }
예제 #5
0
 public void InsertRow(int index, DataRow2 row)
 {
     Rows.Insert(index, row);
 }
예제 #6
0
 public void AddRow(DataRow2 row)
 {
     Rows.Add(row);
 }
예제 #7
0
 public void AddRow(DataRow2 row)
 {
     Rows.Add(row);
 }
예제 #8
0
 private int GetIntValue(DataRow2 row, int colInd)
 {
     bool isInt = columnTypes[colInd] == ColumnType.Integer;
     object o = row[colInd];
     if (isInt){
         if (o == null || o is DBNull || o.ToString().Length == 0){
             return 0;
         }
         return (int) o;
     }
     return 0;
 }
예제 #9
0
 private double GetDoubleValue(DataRow2 row, int colInd)
 {
     bool isInt = columnTypes[colInd] == ColumnType.Integer;
     bool isDouble = IsNumeric(colInd);
     object o = row[colInd];
     if (isInt || isDouble){
         if (o == null || o is DBNull || o.ToString().Length == 0){
             return double.NaN;
         }
         if (isInt){
             return (int) o;
         }
         return (double) o;
     }
     return double.NaN;
 }
예제 #10
0
 public void RemoveRow(DataRow2 row)
 {
     Rows.Remove(row);
 }
예제 #11
0
 public void InsertRow(int index, DataRow2 row)
 {
     Rows.Insert(index, row);
 }