コード例 #1
0
ファイル: Table.cs プロジェクト: killbug2004/WSProf
 private void SetCellRangeBorders(Rectangle rcRanges, int iWidth, Color colour, Border.BorderSide side)
 {
     // go through them, setting colour.
     for (int iRow = rcRanges.Top; iRow < rcRanges.Bottom; iRow++)
     {
         for (int iCol = rcRanges.Left; iCol < rcRanges.Right; iCol++)
         {
             Cell c = m_cells[iRow, iCol];
             if (c == null)
             {
                 m_cells[iRow, iCol] = new Cell();
                 c = m_cells[iRow, iCol];
             }
             c.Borders.Add(new Border(iWidth, colour, side));
         }
     }
 }
コード例 #2
0
ファイル: Table.cs プロジェクト: killbug2004/WSProf
 private void SetCellsColour(List<FilledArea> areas)
 {
     foreach (FilledArea fa in areas)
     {
         // get cell range as rect
         Rectangle rcBounds = fa.Bounds;
         rcBounds.Inflate(-1, -1);
         Rectangle rcRanges = DetermineCellRange(rcBounds);
         // go through them, setting colour.
         for (int iRow = rcRanges.Top; iRow < rcRanges.Bottom; iRow++)
         {
             for (int iCol = rcRanges.Left; iCol < rcRanges.Right; iCol++)
             {
                 Cell c = m_cells[iRow, iCol];
                 if (c == null)
                 {
                     m_cells[iRow, iCol] = new Cell();
                     c = m_cells[iRow, iCol];
                 }
                 // check if already got a colour! - but then what? is unlikely
                 c.BackColour = fa.Colour;
             }
         }
     }
 }