Exemple #1
0
        public Row(uint rowIndex, List <CellScheme> schemes)
        {
            RowIndex = rowIndex;
            m_cells  = new List <Cell>();

            for (int i = 0; i < schemes.Count; ++i)
            {
                CellScheme scheme = schemes[i];
                m_cells.Add(Cell.Create((uint)i, scheme));
            }
        }
Exemple #2
0
        bool ReadFieldNames(IExcelDataReader reader)
        {
            if (!reader.Read())
            {
                Console.WriteLine("Sheet \"{0}\" does not have field name row", Name);
                return(false);
            }

            for (int i = 0; i < reader.FieldCount; ++i)
            {
                CellScheme scheme = new CellScheme();
                scheme.Name = reader.GetString(i);
                m_schemes.Add(scheme);
            }

            return(true);
        }
Exemple #3
0
        public static Cell Create(uint columnIndex, CellScheme scheme)
        {
            switch (scheme.Type)
            {
            case CellScheme.eType.Int:
                return(new CellInt(columnIndex, scheme));

            case CellScheme.eType.Float:
                return(new CellFloat(columnIndex, scheme));

            case CellScheme.eType.Bool:
                return(new CellBool(columnIndex, scheme));

            case CellScheme.eType.String:
                return(new CellString(columnIndex, scheme));

            case CellScheme.eType.Comment:
                return(new CellComment(columnIndex, scheme));

            default:
                return(null);
            }
        }
Exemple #4
0
 public CellBool(uint columnIndex, CellScheme scheme)
     : base(columnIndex, scheme)
 {
 }
Exemple #5
0
 public CellFloat(uint columnIndex, CellScheme scheme)
     : base(columnIndex, scheme)
 {
 }
Exemple #6
0
 public Cell(uint columnIndex, CellScheme scheme)
 {
     ColumnIndex = columnIndex;
     m_scheme    = scheme;
 }
Exemple #7
0
 public CellComment(uint columnIndex, CellScheme scheme)
     : base(columnIndex, scheme)
 {
 }
Exemple #8
0
 public CellString(uint columnIndex, CellScheme scheme)
     : base(columnIndex, scheme)
 {
 }