Пример #1
0
 private void patternHitsDataGridView_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
 {
     if (this.currentList == null || e.RowIndex < 0)
     {
         return;
     }
     if (e.ColumnIndex == 1)
     {
         e.PaintBackground(e.CellBounds, false);
         int selCount  = (this.patternArgs.endLine - this.patternArgs.startLine);
         int maxWeight = this.patternArgs.maxDiffInBlock * selCount + selCount;
         if (maxWeight > 0)
         {
             int       width = (int)(((double)(int)e.Value / (double)maxWeight) * (double)e.CellBounds.Width);
             Rectangle rect  = new Rectangle(e.CellBounds.X, e.CellBounds.Y, width, e.CellBounds.Height);
             int       alpha = 90 + (int)(((double)(int)e.Value / (double)maxWeight) * (double)165);
             Color     color = Color.FromArgb(alpha, 170, 180, 150);
             Brush     brush = new SolidBrush(color);
             rect.Inflate(-2, -1);
             e.Graphics.FillRectangle(brush, rect);
             brush.Dispose();
         }
         e.PaintContent(e.CellBounds);
         e.Handled = true;
     }
     else
     {
         DataGridView gridView = (DataGridView)sender;
         int          rowIndex = GetLineForHitGrid(e.RowIndex);
         PaintHelper.CellPainting(logWindow, gridView, rowIndex, e);                //TODO Zarunbal: check if it works!
     }
 }
Пример #2
0
        private void contentDataGridView_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
        {
            if (this.currentBlock == null || e.RowIndex < 0)
            {
                return;
            }
            DataGridView gridView = (DataGridView)sender;
            int          rowIndex = GetLineForContentGrid(e.RowIndex);

            PaintHelper.CellPainting(logWindow, gridView, rowIndex, e);
        }