Grasshopper project system now uses csproj extension
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / DataGridViewRowPrePaintEventArgs.cs
index e153a302f5f9e96b5a4b4b5f7f40b3ab680b7d73..7454f08245eba53668e222910c366c9d42f7d43c 100644 (file)
@@ -101,26 +101,68 @@ namespace System.Windows.Forms {
                }
 
                public void DrawFocus (Rectangle bounds, bool cellsPaintSelectionBackground) {
-                       throw new NotImplementedException();
+                       if (rowIndex < 0 || rowIndex >= dataGridView.Rows.Count) {
+                               throw new InvalidOperationException("Invalid RowIndex.");
+                       }
+                       Color color;
+                       if (cellsPaintSelectionBackground) {
+                               color = dataGridView.Rows[rowIndex].InheritedStyle.SelectionBackColor;
+                       }
+                       else {
+                               color = dataGridView.Rows[rowIndex].InheritedStyle.BackColor;
+                       }
+                       ///////// NOT CHECKED //////////////
+                       graphics.FillRectangle(new SolidBrush(color), bounds);
                }
 
                public void PaintCells (Rectangle clipBounds, DataGridViewPaintParts paintParts) {
+                       if (rowIndex < 0 || rowIndex >= dataGridView.Rows.Count) {
+                               throw new InvalidOperationException("Invalid RowIndex.");
+                       }
                        throw new NotImplementedException();
                }
 
                public void PaintCellsBackground (Rectangle clipBounds, bool cellsPaintSelectionBackground) {
-                       throw new NotImplementedException();
+                       if (rowIndex < 0 || rowIndex >= dataGridView.Rows.Count) {
+                               throw new InvalidOperationException("Invalid RowIndex.");
+                       }
+                       Color color;
+                       if (cellsPaintSelectionBackground) {
+                               color = dataGridView.Rows[rowIndex].InheritedStyle.SelectionBackColor;
+                       }
+                       else {
+                               color = dataGridView.Rows[rowIndex].InheritedStyle.BackColor;
+                       }
+                       ///////// NOT CHECKED //////////////
+                       graphics.FillRectangle(new SolidBrush(color), clipBounds);
                }
 
                public void PaintCellsContent (Rectangle clipBounds) {
+                       if (rowIndex < 0 || rowIndex >= dataGridView.Rows.Count) {
+                               throw new InvalidOperationException("Invalid RowIndex.");
+                       }
                        throw new NotImplementedException();
                }
 
                public void PaintHeader (bool paintSelectionBackground) {
-                       throw new NotImplementedException();
+                       if (rowIndex < 0 || rowIndex >= dataGridView.Rows.Count) {
+                               throw new InvalidOperationException("Invalid RowIndex.");
+                       }
+                       Color color;
+                       if (paintSelectionBackground) {
+                               color = dataGridView.Rows[rowIndex].InheritedStyle.SelectionBackColor;
+                       }
+                       else {
+                               color = dataGridView.RowHeadersDefaultCellStyle.BackColor;
+                       }
+                       ///////// NOT CHECKED //////////////
+                       graphics.FillRectangle(new SolidBrush(color), clipBounds);
                }
 
                public void PaintHeader (DataGridViewPaintParts paintParts) {
+                       if (rowIndex < 0 || rowIndex >= dataGridView.Rows.Count) {
+                               throw new InvalidOperationException("Invalid RowIndex.");
+                       }
                        throw new NotImplementedException();
                }