2 writes to Owner
System.Windows.Forms.Tests (2)
System\Windows\Forms\AccessibleObjects\DataGridViewCellAccessibleObjectTests.cs (2)
294Owner = owner 306Assert.Throws<InvalidOperationException>(() => accessibleObject.Owner = owner);
178 references to Owner
System.Windows.Forms (164)
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.DataGridViewButtonCellAccessibleObject.cs (2)
23if (Owner is null) 28if (Owner is not DataGridViewButtonCell dataGridViewCell)
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.DataGridViewCellAccessibleObject.cs (2)
36if (Owner is null) 41return !Owner.ReadOnly ? SR.DataGridView_AccCellDefaultAction : string.Empty;
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.DataGridViewCheckBoxCellAccessibleObject.cs (12)
23if (Owner is null) 28if (Owner is not DataGridViewButtonCell dataGridViewCheckBoxCell) 51if (Owner is null) 56if (Owner.ReadOnly) 63switch (Owner.FormattedValue) 79if (Owner is null) 84if (Owner is not DataGridViewCheckBoxCell dataGridViewCell) 117if (Owner is DataGridViewCheckBoxCell checkBoxCell) 153if (Owner is not DataGridViewCheckBoxCell) 155throw new InvalidOperationException(string.Format(SR.DataGridViewCellAccessibleObject_OwnerWrongType, Owner is null ? "null" : Owner.GetType().Name)); 158return ((Owner as DataGridViewCheckBoxCell)?.CheckState) switch
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.DataGridViewColumnHeaderCellAccessibleObject.cs (46)
24=> Owner?.DataGridView is not null && Owner.OwningColumn is not null 25? Owner.DataGridView.RowHeadersVisible 26? Owner.DataGridView.Columns.GetVisibleIndex(Owner.OwningColumn) + 1 27: Owner.DataGridView.Columns.GetVisibleIndex(Owner.OwningColumn) 30public override Rectangle Bounds => Owner is null 32: (Owner.DataGridView?.IsHandleCreated == true) ? GetAccessibleObjectBounds(Parent) : Rectangle.Empty; 38if (Owner is null) 43if (Owner.OwningColumn is not null) 45if (Owner.OwningColumn.SortMode == DataGridViewColumnSortMode.Automatic) 49else if (Owner.DataGridView is not null && ( 50Owner.DataGridView.SelectionMode == DataGridViewSelectionMode.FullColumnSelect || 51Owner.DataGridView.SelectionMode == DataGridViewSelectionMode.ColumnHeaderSelect)) 61public override string Name => Owner is null 63: Owner.OwningColumn?.HeaderText ?? string.Empty; 66public override AccessibleObject? Parent => Owner is null 68: Owner.DataGridView?.AccessibilityObject.GetChild(0); 76if (Owner is null) 90if (Owner.DataGridView is not null && Owner.OwningColumn is not null && Owner.OwningColumn.Selected) 92if (Owner.DataGridView.SelectionMode is DataGridViewSelectionMode.FullColumnSelect 107if (Owner is null) 112if (Owner is not DataGridViewColumnHeaderCell dataGridViewCell) 140if (Owner is null) 145if (Owner.OwningColumn is null || Owner.DataGridView is null) 152AccessibleNavigation.Right => Owner.DataGridView.RightToLeft == RightToLeft.No ? NavigateForward() : NavigateBackward(), 154AccessibleNavigation.Left => Owner.DataGridView.RightToLeft == RightToLeft.No ? NavigateBackward() : NavigateForward(), 162Debug.Assert(Owner is not null); 165if (Owner.OwningColumn is null || Owner.DataGridView is null) 170if (Owner.OwningColumn == Owner.DataGridView.Columns.GetFirstColumn(DataGridViewElementStates.Visible)) 173return Owner.DataGridView.RowHeadersVisible ? Parent?.GetChild(0) : null; 184Debug.Assert(Owner is not null); 187if (Owner.OwningColumn is null || 188Owner.DataGridView is null || 189Owner.OwningColumn == Owner.DataGridView.Columns.GetLastColumn(DataGridViewElementStates.Visible, 202if (Owner is null) 207if (Owner is not DataGridViewColumnHeaderCell dataGridViewCell) 242if (Owner is null) 269UIA_PROPERTY_ID.UIA_IsEnabledPropertyId => (VARIANT)(Owner?.DataGridView?.Enabled ?? false),
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.DataGridViewComboBoxCellAccessibleObject.cs (2)
40if (Owner is null) 45if (Owner.Properties.TryGetValue(s_propComboBoxCellEditingComboBox, out DataGridViewComboBoxEditingControl? comboBox)
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.DataGridViewImageCellAccessibleObject.cs (3)
19public override string? Description => Owner is DataGridViewImageCell imageCell ? imageCell.Description : null; 34if (Owner is null) 39if (Owner is not DataGridViewImageCell dataGridViewCell)
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.DataGridViewLinkCellAccessibleObject.cs (2)
21if (Owner is null) 26if (Owner is not DataGridViewLinkCell dataGridViewCell)
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.DataGridViewRowHeaderCellAccessibleObject.cs (54)
22if (Owner is null) 27if (Owner.DataGridView is null || Owner.OwningRow is null || ParentPrivate is null) 35cellRect.Width = Owner.DataGridView.RowHeadersWidth; 36if (Owner.DataGridView.RightToLeft == RightToLeft.Yes) 49if (Owner is null) 54if (Owner.DataGridView is not null && 55(Owner.DataGridView.SelectionMode == DataGridViewSelectionMode.FullRowSelect || 56Owner.DataGridView.SelectionMode == DataGridViewSelectionMode.RowHeaderSelect)) 73if (Owner is null) 78return Owner.OwningRow?.AccessibilityObject; 88if (Owner is null) 102if (Owner.DataGridView is not null && 103(Owner.DataGridView.SelectionMode == DataGridViewSelectionMode.FullRowSelect || 104Owner.DataGridView.SelectionMode == DataGridViewSelectionMode.RowHeaderSelect)) 106if (Owner.OwningRow is not null && Owner.OwningRow.Selected) 120if (Owner is null) 125if (Owner.DataGridView?.IsHandleCreated == true && 126Owner.OwningRow is not null && 127(Owner.DataGridView.SelectionMode == DataGridViewSelectionMode.FullRowSelect || 128Owner.DataGridView.SelectionMode == DataGridViewSelectionMode.RowHeaderSelect)) 130Owner.OwningRow.Selected = true; 136if (Owner is null) 141if (Owner.OwningRow is null || Owner.DataGridView is null) 149return (Owner.DataGridView.Columns.GetColumnCount(DataGridViewElementStates.Visible) > 0) 155if (Owner.OwningRow.Index == Owner.DataGridView.Rows.GetLastRow(DataGridViewElementStates.Visible)) 160int nextVisibleRow = Owner.DataGridView.Rows.GetNextRow(Owner.OwningRow.Index, DataGridViewElementStates.Visible); 161int actualDisplayIndex = Owner.DataGridView.Rows.GetRowCount(DataGridViewElementStates.Visible, 0, nextVisibleRow); 163if (Owner.DataGridView.ColumnHeadersVisible) 169return Owner.DataGridView.AccessibilityObject.GetChild(actualDisplayIndex)?.GetChild(0); 174if (Owner.OwningRow.Index == Owner.DataGridView.Rows.GetFirstRow(DataGridViewElementStates.Visible)) 176if (!Owner.DataGridView.ColumnHeadersVisible) 182Debug.Assert(Owner.DataGridView.TopLeftHeaderCell.AccessibilityObject == Owner.DataGridView.AccessibilityObject.GetChild(0)!.GetChild(0)); 183return Owner.DataGridView.AccessibilityObject.GetChild(0)?.GetChild(0); 187int previousVisibleRow = Owner.DataGridView.Rows.GetPreviousRow(Owner.OwningRow.Index, DataGridViewElementStates.Visible); 188int actualDisplayIndex = Owner.DataGridView.Rows.GetRowCount(DataGridViewElementStates.Visible, 0, previousVisibleRow); 189if (Owner.DataGridView.ColumnHeadersVisible) 195return Owner.DataGridView.AccessibilityObject.GetChild(actualDisplayIndex)?.GetChild(0); 207if (Owner is null) 212if (Owner is not DataGridViewRowHeaderCell dataGridViewCell) 247if (Owner is null) 252if (Owner.OwningRow is null) 259NavigateDirection.NavigateDirection_Parent => Owner.OwningRow.AccessibilityObject, 261(Owner.DataGridView is not null && Owner.DataGridView.Columns.GetColumnCount(DataGridViewElementStates.Visible) > 0) 262? Owner.OwningRow.AccessibilityObject.GetChild(1) // go to the next sibling 277UIA_PROPERTY_ID.UIA_IsEnabledPropertyId => (VARIANT)(Owner?.DataGridView?.Enabled ?? false),
System\Windows\Forms\Controls\DataGridView\DataGridViewTopLeftHeaderCell.DataGridViewTopLeftHeaderCellAccessibleObject.cs (41)
22if (Owner is null) 27if (Owner.DataGridView is null || !Owner.DataGridView.IsHandleCreated) 32Rectangle cellRect = Owner.DataGridView.GetCellDisplayRectangle(-1, -1, cutOverflow: false); 33return Owner.DataGridView.RectangleToScreen(cellRect); 41if (Owner is null) 46if (Owner.DataGridView?.MultiSelect ?? false) 61if (Owner is null) 66object? value = Owner.Value; 78if (Owner.DataGridView is not null) 80if (Owner.DataGridView.RightToLeft == RightToLeft.No) 105if (Owner is null) 120if (Owner.DataGridView is not null && Owner.DataGridView.AreAllCellsSelected(includeInvisibleCells: false)) 141if (Owner?.DataGridView?.IsHandleCreated is true) 143Owner.DataGridView.SelectAll(); 149if (Owner is null) 154if (Owner.DataGridView is null) 159Debug.Assert(Owner.DataGridView.RowHeadersVisible, "if the row headers are not visible how did you get the top left header cell acc object?"); 165if (Owner.DataGridView.RightToLeft == RightToLeft.No) 177if (Owner.DataGridView.RightToLeft == RightToLeft.No) 193if (Owner is null) 198if (Owner.DataGridView?.IsHandleCreated != true) 207Owner.DataGridView.Focus(); 208if (Owner.DataGridView.Columns.GetColumnCount(DataGridViewElementStates.Visible) > 0 && 209Owner.DataGridView.Rows.GetRowCount(DataGridViewElementStates.Visible) > 0) 213DataGridViewRow row = Owner.DataGridView.Rows[Owner.DataGridView.Rows.GetFirstRow(DataGridViewElementStates.Visible)]; 214DataGridViewColumn col = Owner.DataGridView.Columns.GetFirstColumn(DataGridViewElementStates.Visible)!; 218Owner.DataGridView.SetCurrentCellAddressCoreInternal( 230if (Owner.DataGridView.MultiSelect) 232Owner.DataGridView.SelectAll(); 241Owner.DataGridView.ClearSelection(); 247if (Owner is null) 252if (Owner.DataGridView is null || Owner.DataGridView.Columns.GetColumnCount(DataGridViewElementStates.Visible) == 0) 258return Owner.DataGridView.AccessibilityObject.GetChild(0)?.GetChild(1); 264if (Owner is null) 269if (Owner.DataGridView is null) 274DataGridView dataGridView = Owner.DataGridView; 302UIA_PROPERTY_ID.UIA_IsEnabledPropertyId => (VARIANT)(Owner?.DataGridView?.Enabled ?? false),
System.Windows.Forms.Tests (14)
System\Windows\Forms\AccessibleObjects\DataGridViewButtonCellAccessibleObjectTests.cs (1)
14Assert.Null(accessibleObject.Owner);
System\Windows\Forms\AccessibleObjects\DataGridViewCellAccessibleObjectTests.cs (4)
20Assert.Null(accessibleObject.Owner); 100Assert.Equal(owner, accessibleObject.Owner); 297Assert.Same(owner, accessibleObject.Owner); 1076Assert.Null(accessibleObject.Owner.OwningRow);
System\Windows\Forms\AccessibleObjects\DataGridViewCheckBoxCellAccessibleObjectTests.cs (1)
14Assert.Null(accessibleObject.Owner);
System\Windows\Forms\AccessibleObjects\DataGridViewColumnHeaderCellAccessibleObjectTests.cs (1)
15Assert.Null(accessibleObject.Owner);
System\Windows\Forms\AccessibleObjects\DataGridViewImageCellAccessibleObjectTests.cs (1)
15Assert.Null(accessibleObject.Owner);
System\Windows\Forms\AccessibleObjects\DataGridViewLinkCellAccessibleObjectTests.cs (1)
15Assert.Null(accessibleObject.Owner);
System\Windows\Forms\AccessibleObjects\DataGridViewRowHeaderCellAccessibleObjectTests.cs (2)
15Assert.Null(accessibleObject.Owner); 155Assert.Null(accessibleObject.Owner.OwningRow);
System\Windows\Forms\AccessibleObjects\DataGridViewTopLeftHeaderCellAccessibleObjectTests.cs (1)
16Assert.Null(accessibleObject.Owner);
System\Windows\Forms\DataGridViewCellTests.cs (2)
3421Assert.Same(cell, accessibleObject.Owner); 3449Assert.Same(cell, instance.Owner);