2007-01-07 Jonathan Pobst <monkey@jpobst.com>
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / DataGridViewRowPostPaintEventArgs.cs
index 55e4b23231ce37cde595a3d38a93a013466b9d53..5f7d4bc1552d905fcbcee20be65becfede3dd4b5 100644 (file)
@@ -31,7 +31,7 @@ using System.Drawing;
 
 namespace System.Windows.Forms {
 
-       public class DataGridViewRowPostPaintEventArgs : HandledEventArgs {
+       public class DataGridViewRowPostPaintEventArgs : EventArgs {
 
                private DataGridView dataGridView;
                private Graphics graphics;
@@ -95,26 +95,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();
                }