From 0ee5b0dae353f939c1547708ce4fe04610aff6f3 Mon Sep 17 00:00:00 2001 From: Tim Miller Date: Mon, 22 Jan 2024 23:32:02 +0900 Subject: [PATCH 1/2] Add Obsolete tag for old IndexOf --- src/Core/src/Extensions/EnumerableExtensions.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Core/src/Extensions/EnumerableExtensions.cs b/src/Core/src/Extensions/EnumerableExtensions.cs index fb1fef33d8c0..c101a9c7d8d4 100644 --- a/src/Core/src/Extensions/EnumerableExtensions.cs +++ b/src/Core/src/Extensions/EnumerableExtensions.cs @@ -20,14 +20,7 @@ public static void ForEach(this IEnumerable enumeration, Action action) } } - /// - /// - /// - /// - /// - /// - /// - /// + [Obsolete("Legacy API used in previous versions of XAML Hot Reload. Do not use.")] public static IDictionary> GroupToDictionary(this IEnumerable enumeration, Func func) where TKey : notnull { @@ -76,6 +69,7 @@ public static int IndexOf(this IEnumerable enumerable, T item) /// /// Find the index for the first occurrence of an item within the collection as matched through the specified predicate. + /// Used by XAML Hot Reload. /// /// The type of object contained in this collection. /// The collection in which to look for the item. @@ -83,6 +77,7 @@ public static int IndexOf(this IEnumerable enumerable, T item) /// The item currently evaluated of type is provided as an input parameter. /// The resulting value should be a which is if this is the item to match, otherwise . /// The index of the first item to match through in the collection or -1 when no match is not found. + [Obsolete("Use IndexOf(IEnumerable, T item) instead.")] public static int IndexOf(this IEnumerable enumerable, Func predicate) { var i = 0; From 0218440113257757a848738b8df15bf5e12b419d Mon Sep 17 00:00:00 2001 From: Tim Miller Date: Mon, 22 Jan 2024 23:50:33 +0900 Subject: [PATCH 2/2] Add docs to make build happy. --- src/Core/src/Extensions/EnumerableExtensions.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Core/src/Extensions/EnumerableExtensions.cs b/src/Core/src/Extensions/EnumerableExtensions.cs index c101a9c7d8d4..0441488756d2 100644 --- a/src/Core/src/Extensions/EnumerableExtensions.cs +++ b/src/Core/src/Extensions/EnumerableExtensions.cs @@ -20,6 +20,17 @@ public static void ForEach(this IEnumerable enumeration, Action action) } } + /// + /// Groups elements from an IEnumerable based on a specified key selector function and returns a dictionary + /// where keys are the computed keys and values are lists of elements with the same key. + /// Used by XAML Hot Reload. + /// + /// The type of elements in the input enumeration. + /// The type of keys produced by the key selector function. + /// The input IEnumerable of elements to be grouped. + /// A function that extracts a key from an element of the input enumeration. + /// A dictionary with keys as computed by the key selector function and values as lists of elements + /// that share the same key. [Obsolete("Legacy API used in previous versions of XAML Hot Reload. Do not use.")] public static IDictionary> GroupToDictionary(this IEnumerable enumeration, Func func) where TKey : notnull