예제 #1
0
        public AutomationDataGridViewCell(AutomationDataGridView grid, AutomationDataGridViewRow row, DataGridViewCell cell)
        {
            if (grid == null)
            {
                throw new ArgumentNullException("grid");
            }

            if (row == null)
            {
                throw new ArgumentNullException("row");
            }

            if (cell == null)
            {
                throw new ArgumentNullException("cell");
            }

            _grid = grid;
            _row = row;
            _cell = cell;
        }
예제 #2
0
        /// <summary>
        /// Retrieves the element in this fragment that is at the specified point.
        /// </summary>
        /// <param name="x">The X coordinate,.</param>
        /// <param name="y">The Y coordinate.</param>
        /// <returns>
        /// The provider for the child element at the specified point, if one exists, or the root provider if the point is on this element but not on any child element. Otherwise returns null.
        /// </returns>
        IRawElementProviderFragment IRawElementProviderFragmentRoot.ElementProviderFromPoint(double x, double y)
        {
            AutomationDataGridViewRow returnRow = null;

            this.Invoke(new MethodInvoker(delegate()
            {
                System.Drawing.Point clientPoint = new System.Drawing.Point((int)x, (int)y);
                clientPoint = this.PointToClient(clientPoint);

                foreach (DataGridViewRow row in this.Rows)
                {
                    if (this.GetRowDisplayRectangle(row.Index, false).Contains(clientPoint))
                    {
                        returnRow = new AutomationDataGridViewRow(this, row);
                        break;
                    }
                }
            }));

            return returnRow;
        }