예제 #1
0
 public string this[DCTDataColumn column]
 {
     get
     {
         string result = "";
         if (dataCells.TryGetValue(column.Name, out result))
         {
             return(result);
         }
         return("");
     }
     set
     {
         dataCells[column.Name] = value;
     }
 }
예제 #2
0
        public static DCTDataRow FromTableRow(TableRow row, DCTDataColumnCollection colCollection)
        {
            List <TableCell> cells  = row.Descendants <TableCell>().ToList();
            DCTDataRow       result = new DCTDataRow();

            result.isEmpty = true;
            for (int i = 0; i < cells.Count; i++)
            {
                DCTDataColumn column = null;
                if (colCollection.TryGetValue(i, out column))
                {
                    if (!string.IsNullOrEmpty(cells[i].InnerText))
                    {
                        result.isEmpty = false;
                    }
                    result[column] = cells[i].InnerText;
                }
            }
            return(result);
        }