System.Windows.Forms.ThemeWin32Classic.DataGridPaintParentRows C# (CSharp) Method

DataGridPaintParentRows() public method

public DataGridPaintParentRows ( Graphics g, Rectangle clip, System.Windows.Forms.DataGrid grid ) : void
g System.Drawing.Graphics
clip System.Drawing.Rectangle
grid System.Windows.Forms.DataGrid
return void
		public override void DataGridPaintParentRows (Graphics g, Rectangle clip, DataGrid grid)
		{
			Rectangle rect_row = new Rectangle ();

			rect_row.X = grid.ParentRowsArea.X;
			rect_row.Width = grid.ParentRowsArea.Width;
			rect_row.Height = (grid.CaptionFont.Height + 3);

			object[] parentRows = grid.data_source_stack.ToArray();
			
			Region current_clip;
			Region prev_clip = g.Clip;
			for (int row = 0; row < parentRows.Length; row++) {
				rect_row.Y = grid.ParentRowsArea.Y + row * rect_row.Height;

				if (clip.IntersectsWith (rect_row) == false)
					continue;

				current_clip = new Region (rect_row);
				current_clip.Intersect (prev_clip);
				g.Clip = current_clip;

				DataGridPaintParentRow (g, rect_row, (DataGridDataSource)parentRows[parentRows.Length - row - 1], grid);

				current_clip.Dispose ();
			}
			
			g.Clip = prev_clip;
		}
ThemeWin32Classic