96 references to ListViewGroupCollapsedState
System.Windows.Forms (31)
System\Windows\Forms\Controls\ListView\ListView.cs (9)
4422
listViewGroup.CollapsedState ==
ListViewGroupCollapsedState
.Collapsed
5716
if (group.CollapsedState !=
ListViewGroupCollapsedState
.Default)
5719
if (group.CollapsedState ==
ListViewGroupCollapsedState
.Collapsed)
6366
if (targetGroup.CollapsedState ==
ListViewGroupCollapsedState
.Default)
6371
targetGroup.CollapsedState = targetGroup.CollapsedState ==
ListViewGroupCollapsedState
.Expanded
6372
?
ListViewGroupCollapsedState
.Collapsed
6373
:
ListViewGroupCollapsedState
.Expanded;
6926
if (group is null || group.CollapsedState is
ListViewGroupCollapsedState
.Default || !groups.Add(group.ID))
6931
ListViewGroupCollapsedState
nativeState = group.GetNativeCollapsedState();
System\Windows\Forms\Controls\ListView\ListViewGroup.cs (14)
23
private
ListViewGroupCollapsedState
_collapsedState =
ListViewGroupCollapsedState
.Default;
176
/// Controls which <see cref="
ListViewGroupCollapsedState
"/> the group will appear as.
179
/// One of the <see cref="
ListViewGroupCollapsedState
"/> values that specifies how the group is displayed.
180
/// The default is <see cref="
ListViewGroupCollapsedState
.Default"/>.
183
/// The specified value when setting this property is not a valid <see cref="
ListViewGroupCollapsedState
"/> value.
185
[DefaultValue(
ListViewGroupCollapsedState
.Default)]
187
public
ListViewGroupCollapsedState
CollapsedState
391
internal
ListViewGroupCollapsedState
GetNativeCollapsedState()
400
return
ListViewGroupCollapsedState
.Default;
411
return
ListViewGroupCollapsedState
.Default;
414
return state.HasFlag(LIST_VIEW_GROUP_STATE_FLAGS.LVGS_COLLAPSED) ?
ListViewGroupCollapsedState
.Collapsed :
ListViewGroupCollapsedState
.Expanded;
430
internal void SetCollapsedStateInternal(
ListViewGroupCollapsedState
state)
System\Windows\Forms\Controls\ListView\ListViewGroup.ListViewGroupAccessibleObject.cs (5)
54
uint rectType = _owningGroup.CollapsedState ==
ListViewGroupCollapsedState
.Collapsed
95
_owningGroup.CollapsedState ==
ListViewGroupCollapsedState
.Collapsed
147
=> _owningGroup.CollapsedState =
ListViewGroupCollapsedState
.Collapsed;
152
=> _owningGroup.CollapsedState =
ListViewGroupCollapsedState
.Expanded;
303
UIA_PATTERN_ID.UIA_ExpandCollapsePatternId => _owningGroup.CollapsedState !=
ListViewGroupCollapsedState
.Default,
System\Windows\Forms\Controls\ListView\ListViewItem.IKeyboardToolTip.cs (1)
90
if (item.Group is not null && item.Group.CollapsedState ==
ListViewGroupCollapsedState
.Collapsed)
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemBaseAccessibleObject.cs (2)
40
=> !_owningListView.IsHandleCreated || OwningGroup?.CollapsedState ==
ListViewGroupCollapsedState
.Collapsed
186
if (OwningGroup?.CollapsedState ==
ListViewGroupCollapsedState
.Collapsed)
System.Windows.Forms.Tests (60)
System\Windows\Forms\AccessibleObjects\ListViewGroup.ListViewGroupAccessibleObjectTests.cs (21)
709
CollapsedState =
ListViewGroupCollapsedState
.Expanded
718
CollapsedState =
ListViewGroupCollapsedState
.Collapsed
743
CollapsedState =
ListViewGroupCollapsedState
.Expanded
763
Assert.Equal(
ListViewGroupCollapsedState
.Collapsed, listViewGroup.GetNativeCollapsedState());
769
Assert.Equal(
ListViewGroupCollapsedState
.Collapsed, listViewGroup.GetNativeCollapsedState());
774
Assert.Equal(
ListViewGroupCollapsedState
.Expanded, listViewGroup.GetNativeCollapsedState());
780
Assert.Equal(
ListViewGroupCollapsedState
.Expanded, listViewGroup.GetNativeCollapsedState());
785
[InlineData(
ListViewGroupCollapsedState
.Collapsed)]
786
[InlineData(
ListViewGroupCollapsedState
.Expanded)]
787
public void ListViewGroupAccessibleObject_GroupCollapsedStateChanged_IsExpected_ForMultipleSelection(
ListViewGroupCollapsedState
firstGroupSate)
794
ListViewGroup group2 = new("Group 2") { CollapsedState =
ListViewGroupCollapsedState
.Expanded };
795
ListViewGroup group3 = new("Group 3") { CollapsedState =
ListViewGroupCollapsedState
.Expanded };
812
if (firstGroupSate ==
ListViewGroupCollapsedState
.Collapsed)
829
Assert.Equal(
ListViewGroupCollapsedState
.Collapsed, group2.GetNativeCollapsedState());
830
Assert.Equal(
ListViewGroupCollapsedState
.Collapsed, group2.CollapsedState);
831
Assert.Equal(
ListViewGroupCollapsedState
.Expanded, group3.GetNativeCollapsedState());
832
Assert.Equal(
ListViewGroupCollapsedState
.Expanded, group3.CollapsedState);
1304
foreach (
ListViewGroupCollapsedState
listViewGroupCollapsedState in Enum.GetValues(typeof(
ListViewGroupCollapsedState
)))
1315
public void ListViewGroupAccessibleObject_IsPatternSupported_ReturnFalse_ForCollapsedStateDefault(View view, bool showGroups, bool createHandle,
ListViewGroupCollapsedState
listViewGroupCollapsedState)
1341
bool expectedPatternSupported = listViewGroupCollapsedState !=
ListViewGroupCollapsedState
.Default;
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemAccessibleObjectTests.cs (8)
1187
private ListView GetListViewWithData(View view, bool createControl, bool virtualMode, bool showGroups, bool groupsEnabled = true, bool itemsInGroup = true,
ListViewGroupCollapsedState
state =
ListViewGroupCollapsedState
.Default)
1816
foreach (
ListViewGroupCollapsedState
state in Enum.GetValues(typeof(
ListViewGroupCollapsedState
)))
1830
public void ListViewItemAccessibleObject_GetPropertyValue_ReturnsFalseWhenCollapsedOrOffScreen(View view, bool createControl, bool virtualMode, bool showGroups, bool groupsEnabled, bool itemsInGroup,
ListViewGroupCollapsedState
state)
1835
bool expected = listView.GroupsDisplayed && listView.Items[0].Group?.CollapsedState ==
ListViewGroupCollapsedState
.Collapsed;
1937
CollapsedState =
ListViewGroupCollapsedState
.Expanded
1943
CollapsedState =
ListViewGroupCollapsedState
.Collapsed
System\Windows\Forms\ListViewGroupTests.cs (27)
28
Assert.Equal(
ListViewGroupCollapsedState
.Default, group.CollapsedState);
49
Assert.Equal(
ListViewGroupCollapsedState
.Default, group.CollapsedState);
79
Assert.Equal(
ListViewGroupCollapsedState
.Default, group.CollapsedState);
107
Assert.Equal(
ListViewGroupCollapsedState
.Default, group.CollapsedState);
114
[InlineData(
ListViewGroupCollapsedState
.Default)]
115
[InlineData(
ListViewGroupCollapsedState
.Collapsed)]
116
[InlineData(
ListViewGroupCollapsedState
.Expanded)]
117
public void ListViewGroup_GetNativeCollapsedState_Succeeds(
ListViewGroupCollapsedState
collapsedState)
1040
yield return new object[] {
ListViewGroupCollapsedState
.Default,
ListViewGroupCollapsedState
.Default };
1041
yield return new object[] {
ListViewGroupCollapsedState
.Expanded,
ListViewGroupCollapsedState
.Expanded };
1042
yield return new object[] {
ListViewGroupCollapsedState
.Collapsed,
ListViewGroupCollapsedState
.Collapsed };
1047
public void ListViewGroup_Collapse_SetWithoutListView_GetReturnsExpected(
ListViewGroupCollapsedState
value,
ListViewGroupCollapsedState
expected)
1063
public void ListViewGroup_Collapse_SetWithListView_GetReturnsExpected(
ListViewGroupCollapsedState
value,
ListViewGroupCollapsedState
expected)
1086
public void ListViewGroup_Collapse_SetWithListViewWithHandle_GetReturnsExpected(
ListViewGroupCollapsedState
value,
ListViewGroupCollapsedState
expected)
1133
group.CollapsedState = (
ListViewGroupCollapsedState
)data[0];
1134
ListViewGroupCollapsedState
expectedCollapsedState = (
ListViewGroupCollapsedState
)data[1];
1147
if (expectedCollapsedState ==
ListViewGroupCollapsedState
.Default)
1151
else if (expectedCollapsedState ==
ListViewGroupCollapsedState
.Expanded)
1167
[InvalidEnumData<
ListViewGroupCollapsedState
>]
1168
public void ListViewGroup_CollapsedState_SetInvalid_ThrowsInvalidEnumArgumentException(
ListViewGroupCollapsedState
value)
System\Windows\Forms\ListViewItem.IKeyboardToolTipTests.cs (4)
116
[InlineData(
ListViewGroupCollapsedState
.Default, false)]
117
[InlineData(
ListViewGroupCollapsedState
.Expanded, false)]
118
[InlineData(
ListViewGroupCollapsedState
.Collapsed, true)]
120
ListViewGroupCollapsedState
collapsedState,
System.Windows.Forms.UI.IntegrationTests (3)
ListViewTests.cs (3)
50
ListViewGroup group = new($"Group 1", HorizontalAlignment.Left) { CollapsedState =
ListViewGroupCollapsedState
.Expanded };
103
Assert.Equal(
ListViewGroupCollapsedState
.Collapsed, group.CollapsedState);
110
Assert.Equal(
ListViewGroupCollapsedState
.Expanded, group.CollapsedState);
WinFormsControlsTest (2)
ListViewTest.cs (2)
149
CollapsedState =
ListViewGroupCollapsedState
.Expanded
162
CollapsedState =
ListViewGroupCollapsedState
.Collapsed