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