Exemple #1
0
		/// <summary>
		/// Draw a tint over everything in the ObjectListView except the 
		/// row under the mouse.
		/// </summary>
		/// <param name="olv"></param>
		/// <param name="g"></param>
		/// <param name="r"></param>
		public override void Draw(ObjectListView olv, Graphics g, Rectangle r) {
			if (!r.Contains(olv.PointToClient(Cursor.Position)))
				return;

			Rectangle bounds = this.RowBounds;
			if (bounds.IsEmpty) {
				if (olv.View == View.Tile)
					g.FillRectangle(this.FillBrush, r);
				return;
			}

			using (Region newClip = new Region(r)) {
				bounds.Inflate(this.BoundsPadding);
				newClip.Exclude(this.GetRoundedRect(bounds, this.CornerRounding));
				Region originalClip = g.Clip;
				g.Clip = newClip;
				g.FillRectangle(this.FillBrush, r);
				g.Clip = originalClip;
			}
		}