BrightIdeasSoftware.BaseRenderer.StandardHitTest C# (CSharp) Метод

StandardHitTest() защищенный Метод

Perform normal hit testing relative to the given bounds
protected StandardHitTest ( Graphics g, BrightIdeasSoftware.OlvListViewHitTestInfo hti, Rectangle bounds, int x, int y ) : void
g System.Drawing.Graphics
hti BrightIdeasSoftware.OlvListViewHitTestInfo
bounds System.Drawing.Rectangle
x int
y int
Результат void
        protected void StandardHitTest(Graphics g, OlvListViewHitTestInfo hti, Rectangle bounds, int x, int y)
        {
            Rectangle r = bounds;
            r = ApplyCellPadding(r);

            // Did they hit a check box?
            Rectangle r2 = this.CalculateCheckBoxBounds(g, r);
            Rectangle r3 = r2;
            r3.Inflate(2, 2); // slightly larger hit area
            if (r3.Contains(x, y)) {
                hti.HitTestLocation = HitTestLocation.CheckBox;
                return;
            }
            int width = r2.Width;

            // Did they hit the image? If they hit the image of a
            // non-primary column that has a checkbox, it counts as a
            // checkbox hit
            r.X += width;
            r.Width -= width;
            width = this.CalculateImageWidth(g, this.GetImageSelector());
            r2 = r;
            r2.Width = width;
            if (r2.Contains(x, y)) {
                if (this.Column != null && (this.Column.Index > 0 && this.Column.CheckBoxes))
                    hti.HitTestLocation = HitTestLocation.CheckBox;
                else
                    hti.HitTestLocation = HitTestLocation.Image;
                return;
            }

            // Did they hit the text?
            r.X += width;
            r.Width -= width;
            width = this.CalculateTextWidth(g, this.GetText());
            r2 = r;
            r2.Width = width;
            if (r2.Contains(x, y)) {
                hti.HitTestLocation = HitTestLocation.Text;
                return;
            }

            hti.HitTestLocation = HitTestLocation.InCell;
        }