Exemplo n.º 1
0
        public object this[RowGenre row, ColGenre col, int index = -1]
        {
            get
            {
                CellBase cell = null;
                switch (row)
                {
                case RowGenre.Functional:
                case RowGenre.Statistics:
                case RowGenre.MP:
                    cell = CellList[row].First()[col];
                    return(cell is TextCell ? ((TextCell)cell).Value : 0);

                case RowGenre.BP:
                case RowGenre.AP:
                    if (index == -1)
                    {
                        return(null);
                    }
                    cell = CellList[row][index][col];
                    return(cell is TextCell ? ((TextCell)cell).Value : 0);

                default:
                case RowGenre.Header:
                    return(0);
                }
            }
            set
            {
                switch (row)
                {
                case RowGenre.Header:
                case RowGenre.Functional:
                case RowGenre.Statistics:
                case RowGenre.MP:
                default:
                    CellList[row].First().SetValue(col, value);
                    break;

                case RowGenre.BP:
                case RowGenre.AP:
                    if (index == -1)
                    {
                        return;
                    }
                    else if (index == 999)
                    {
                        for (int i = 0; i < TickNumber; i++)
                        {
                            CellList[row][i].SetValue(col, value);
                        }
                    }
                    else
                    {
                        CellList[row][index].SetValue(col, value);
                    }
                    break;
                }
            }
        }
Exemplo n.º 2
0
 public Row(RowGenre genre)
 {
     Genre = genre;
     InitCell();
 }