@@ -17,7 +17,7 @@ namespace CommunityToolkit.Mvvm.Collections;
17
17
public static class ObservableGroupedCollectionExtensions
18
18
{
19
19
/// <summary>
20
- /// Return the first group with <paramref name="key"/> key.
20
+ /// Returns the first group with <paramref name="key"/> key.
21
21
/// </summary>
22
22
/// <typeparam name="TKey">The type of the group key.</typeparam>
23
23
/// <typeparam name="TElement">The type of the items in the collection.</typeparam>
@@ -49,13 +49,13 @@ static void ThrowArgumentExceptionForKeyNotFound()
49
49
}
50
50
51
51
/// <summary>
52
- /// Return the first group with <paramref name="key"/> key or null if not found.
52
+ /// Returns the first group with <paramref name="key"/> key or <see langword=" null"/> if not found.
53
53
/// </summary>
54
54
/// <typeparam name="TKey">The type of the group key.</typeparam>
55
55
/// <typeparam name="TElement">The type of the items in the collection.</typeparam>
56
56
/// <param name="source">The source <see cref="ObservableGroupedCollection{TKey, TElement}"/> instance.</param>
57
57
/// <param name="key">The key of the group to query.</param>
58
- /// <returns>The first group matching <paramref name="key"/> or null.</returns>
58
+ /// <returns>The first group matching <paramref name="key"/> or <see langword=" null"/> .</returns>
59
59
/// <exception cref="ArgumentNullException">Thrown if <paramref name="source"/> or <paramref name="key"/> are <see langword="null"/>.</exception>
60
60
public static ObservableGroup < TKey , TElement > ? FirstGroupByKeyOrDefault < TKey , TElement > ( this ObservableGroupedCollection < TKey , TElement > source , TKey key )
61
61
where TKey : notnull
@@ -65,7 +65,7 @@ static void ThrowArgumentExceptionForKeyNotFound()
65
65
66
66
if ( source . TryGetList ( out List < ObservableGroup < TKey , TElement > > ? list ) )
67
67
{
68
- foreach ( ObservableGroup < TKey , TElement > ? group in list )
68
+ foreach ( ObservableGroup < TKey , TElement > group in list )
69
69
{
70
70
if ( EqualityComparer < TKey > . Default . Equals ( group . Key , key ) )
71
71
{
@@ -77,12 +77,12 @@ static void ThrowArgumentExceptionForKeyNotFound()
77
77
}
78
78
79
79
[ MethodImpl ( MethodImplOptions . NoInlining ) ]
80
- static ObservableGroup < TKey , TElement > ? FirstOrDefaultFallback ( ObservableGroupedCollection < TKey , TElement > source , TKey key )
80
+ static ObservableGroup < TKey , TElement > ? FirstGroupByKeyOrDefaultFallback ( ObservableGroupedCollection < TKey , TElement > source , TKey key )
81
81
{
82
82
return Enumerable . FirstOrDefault < ObservableGroup < TKey , TElement > > ( source , group => EqualityComparer < TKey > . Default . Equals ( group . Key , key ) ) ;
83
83
}
84
84
85
- return FirstOrDefaultFallback ( source , key ) ;
85
+ return FirstGroupByKeyOrDefaultFallback ( source , key ) ;
86
86
}
87
87
88
88
/// <summary>
@@ -720,7 +720,7 @@ public static void RemoveGroup<TKey, TValue>(this ObservableGroupedCollection<TK
720
720
{
721
721
int index = 0 ;
722
722
723
- foreach ( ObservableGroup < TKey , TValue > ? group in list )
723
+ foreach ( ObservableGroup < TKey , TValue > group in list )
724
724
{
725
725
if ( EqualityComparer < TKey > . Default . Equals ( group . Key , key ) )
726
726
{
@@ -739,7 +739,7 @@ static void RemoveGroupFallback(ObservableGroupedCollection<TKey, TValue> source
739
739
{
740
740
int index = 0 ;
741
741
742
- foreach ( ObservableGroup < TKey , TValue > ? group in source )
742
+ foreach ( ObservableGroup < TKey , TValue > group in source )
743
743
{
744
744
if ( EqualityComparer < TKey > . Default . Equals ( group . Key , key ) )
745
745
{
@@ -776,7 +776,7 @@ public static void RemoveItem<TKey, TValue>(this ObservableGroupedCollection<TKe
776
776
{
777
777
int index = 0 ;
778
778
779
- foreach ( ObservableGroup < TKey , TValue > ? group in list )
779
+ foreach ( ObservableGroup < TKey , TValue > group in list )
780
780
{
781
781
if ( EqualityComparer < TKey > . Default . Equals ( group . Key , key ) )
782
782
{
@@ -800,7 +800,7 @@ static void RemoveItemFallback(ObservableGroupedCollection<TKey, TValue> source,
800
800
{
801
801
int index = 0 ;
802
802
803
- foreach ( ObservableGroup < TKey , TValue > ? group in source )
803
+ foreach ( ObservableGroup < TKey , TValue > group in source )
804
804
{
805
805
if ( EqualityComparer < TKey > . Default . Equals ( group . Key , key ) )
806
806
{
0 commit comments