96 references to ListViewGroupCollapsedState
System.Windows.Forms (31)
System\Windows\Forms\Controls\ListView\ListView.cs (9)
4418listViewGroup.CollapsedState == ListViewGroupCollapsedState.Collapsed 5712if (group.CollapsedState != ListViewGroupCollapsedState.Default) 5715if (group.CollapsedState == ListViewGroupCollapsedState.Collapsed) 6362if (targetGroup.CollapsedState == ListViewGroupCollapsedState.Default) 6367targetGroup.CollapsedState = targetGroup.CollapsedState == ListViewGroupCollapsedState.Expanded 6368? ListViewGroupCollapsedState.Collapsed 6369: ListViewGroupCollapsedState.Expanded; 6922if (group is null || group.CollapsedState is ListViewGroupCollapsedState.Default || !groups.Add(group.ID)) 6927ListViewGroupCollapsedState nativeState = group.GetNativeCollapsedState();
System\Windows\Forms\Controls\ListView\ListViewGroup.cs (14)
23private 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)] 187public ListViewGroupCollapsedState CollapsedState 391internal ListViewGroupCollapsedState GetNativeCollapsedState() 400return ListViewGroupCollapsedState.Default; 411return ListViewGroupCollapsedState.Default; 414return state.HasFlag(LIST_VIEW_GROUP_STATE_FLAGS.LVGS_COLLAPSED) ? ListViewGroupCollapsedState.Collapsed : ListViewGroupCollapsedState.Expanded; 430internal void SetCollapsedStateInternal(ListViewGroupCollapsedState state)
System\Windows\Forms\Controls\ListView\ListViewGroup.ListViewGroupAccessibleObject.cs (5)
54uint rectType = _owningGroup.CollapsedState == ListViewGroupCollapsedState.Collapsed 95_owningGroup.CollapsedState == ListViewGroupCollapsedState.Collapsed 147=> _owningGroup.CollapsedState = ListViewGroupCollapsedState.Collapsed; 152=> _owningGroup.CollapsedState = ListViewGroupCollapsedState.Expanded; 303UIA_PATTERN_ID.UIA_ExpandCollapsePatternId => _owningGroup.CollapsedState != ListViewGroupCollapsedState.Default,
System\Windows\Forms\Controls\ListView\ListViewItem.IKeyboardToolTip.cs (1)
90if (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 186if (OwningGroup?.CollapsedState == ListViewGroupCollapsedState.Collapsed)
System.Windows.Forms.Tests (60)
System\Windows\Forms\AccessibleObjects\ListViewGroup.ListViewGroupAccessibleObjectTests.cs (21)
709CollapsedState = ListViewGroupCollapsedState.Expanded 718CollapsedState = ListViewGroupCollapsedState.Collapsed 743CollapsedState = ListViewGroupCollapsedState.Expanded 763Assert.Equal(ListViewGroupCollapsedState.Collapsed, listViewGroup.GetNativeCollapsedState()); 769Assert.Equal(ListViewGroupCollapsedState.Collapsed, listViewGroup.GetNativeCollapsedState()); 774Assert.Equal(ListViewGroupCollapsedState.Expanded, listViewGroup.GetNativeCollapsedState()); 780Assert.Equal(ListViewGroupCollapsedState.Expanded, listViewGroup.GetNativeCollapsedState()); 785[InlineData(ListViewGroupCollapsedState.Collapsed)] 786[InlineData(ListViewGroupCollapsedState.Expanded)] 787public void ListViewGroupAccessibleObject_GroupCollapsedStateChanged_IsExpected_ForMultipleSelection(ListViewGroupCollapsedState firstGroupSate) 794ListViewGroup group2 = new("Group 2") { CollapsedState = ListViewGroupCollapsedState.Expanded }; 795ListViewGroup group3 = new("Group 3") { CollapsedState = ListViewGroupCollapsedState.Expanded }; 812if (firstGroupSate == ListViewGroupCollapsedState.Collapsed) 829Assert.Equal(ListViewGroupCollapsedState.Collapsed, group2.GetNativeCollapsedState()); 830Assert.Equal(ListViewGroupCollapsedState.Collapsed, group2.CollapsedState); 831Assert.Equal(ListViewGroupCollapsedState.Expanded, group3.GetNativeCollapsedState()); 832Assert.Equal(ListViewGroupCollapsedState.Expanded, group3.CollapsedState); 1304foreach (ListViewGroupCollapsedState listViewGroupCollapsedState in Enum.GetValues(typeof(ListViewGroupCollapsedState))) 1315public void ListViewGroupAccessibleObject_IsPatternSupported_ReturnFalse_ForCollapsedStateDefault(View view, bool showGroups, bool createHandle, ListViewGroupCollapsedState listViewGroupCollapsedState) 1341bool expectedPatternSupported = listViewGroupCollapsedState != ListViewGroupCollapsedState.Default;
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemAccessibleObjectTests.cs (8)
1187private ListView GetListViewWithData(View view, bool createControl, bool virtualMode, bool showGroups, bool groupsEnabled = true, bool itemsInGroup = true, ListViewGroupCollapsedState state = ListViewGroupCollapsedState.Default) 1816foreach (ListViewGroupCollapsedState state in Enum.GetValues(typeof(ListViewGroupCollapsedState))) 1830public void ListViewItemAccessibleObject_GetPropertyValue_ReturnsFalseWhenCollapsedOrOffScreen(View view, bool createControl, bool virtualMode, bool showGroups, bool groupsEnabled, bool itemsInGroup, ListViewGroupCollapsedState state) 1835bool expected = listView.GroupsDisplayed && listView.Items[0].Group?.CollapsedState == ListViewGroupCollapsedState.Collapsed; 1937CollapsedState = ListViewGroupCollapsedState.Expanded 1943CollapsedState = ListViewGroupCollapsedState.Collapsed
System\Windows\Forms\ListViewGroupTests.cs (27)
28Assert.Equal(ListViewGroupCollapsedState.Default, group.CollapsedState); 49Assert.Equal(ListViewGroupCollapsedState.Default, group.CollapsedState); 79Assert.Equal(ListViewGroupCollapsedState.Default, group.CollapsedState); 107Assert.Equal(ListViewGroupCollapsedState.Default, group.CollapsedState); 114[InlineData(ListViewGroupCollapsedState.Default)] 115[InlineData(ListViewGroupCollapsedState.Collapsed)] 116[InlineData(ListViewGroupCollapsedState.Expanded)] 117public void ListViewGroup_GetNativeCollapsedState_Succeeds(ListViewGroupCollapsedState collapsedState) 1037yield return new object[] { ListViewGroupCollapsedState.Default, ListViewGroupCollapsedState.Default }; 1038yield return new object[] { ListViewGroupCollapsedState.Expanded, ListViewGroupCollapsedState.Expanded }; 1039yield return new object[] { ListViewGroupCollapsedState.Collapsed, ListViewGroupCollapsedState.Collapsed }; 1044public void ListViewGroup_Collapse_SetWithoutListView_GetReturnsExpected(ListViewGroupCollapsedState value, ListViewGroupCollapsedState expected) 1060public void ListViewGroup_Collapse_SetWithListView_GetReturnsExpected(ListViewGroupCollapsedState value, ListViewGroupCollapsedState expected) 1083public void ListViewGroup_Collapse_SetWithListViewWithHandle_GetReturnsExpected(ListViewGroupCollapsedState value, ListViewGroupCollapsedState expected) 1130group.CollapsedState = (ListViewGroupCollapsedState)data[0]; 1131ListViewGroupCollapsedState expectedCollapsedState = (ListViewGroupCollapsedState)data[1]; 1144if (expectedCollapsedState == ListViewGroupCollapsedState.Default) 1148else if (expectedCollapsedState == ListViewGroupCollapsedState.Expanded) 1164[InvalidEnumData<ListViewGroupCollapsedState>] 1165public 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)] 120ListViewGroupCollapsedState collapsedState,
System.Windows.Forms.UI.IntegrationTests (3)
ListViewTests.cs (3)
50ListViewGroup group = new($"Group 1", HorizontalAlignment.Left) { CollapsedState = ListViewGroupCollapsedState.Expanded }; 103Assert.Equal(ListViewGroupCollapsedState.Collapsed, group.CollapsedState); 110Assert.Equal(ListViewGroupCollapsedState.Expanded, group.CollapsedState);
WinFormsControlsTest (2)
ListViewTest.cs (2)
149CollapsedState = ListViewGroupCollapsedState.Expanded 162CollapsedState = ListViewGroupCollapsedState.Collapsed