Skip to content

Commit d0d8b27

Browse files
committed
chore: adjust namespace
1 parent 5500d58 commit d0d8b27

File tree

6 files changed

+22
-21
lines changed

6 files changed

+22
-21
lines changed

src/DevTKSS.Extensions.Uno/DevTKSS.Extensions.Uno.csproj renamed to src/DevTKSS.Extensions.Uno.Storage/DevTKSS.Extensions.Uno.Storage.csproj

File renamed without changes.

src/DevTKSS.Extensions.Uno/EnumerableExtensions.string.cs renamed to src/DevTKSS.Extensions.Uno.Storage/EnumerableExtensions.string.cs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static class EnumerableExtensions
1818
/// If <c>true</c>, the start and end indices are treated as 0-based; otherwise, they are treated as 1-based.
1919
/// </param>
2020
/// <returns>
21-
/// An enumerable collection of strings, where each string represents the items within a specified range.
21+
/// An <see cref="IEnumerable{string}"/> where each string represents the items within a specified range.
2222
/// If a range is invalid (e.g. start is greater than the last one), an empty string is returned for that range.
2323
/// </returns>
2424
public static IEnumerable<string> SelectItemsByRanges(this IEnumerable<string> source, IEnumerable<(int Start, int End)> ranges, bool isNullBased = true)
@@ -44,7 +44,7 @@ public static IEnumerable<string> SelectItemsByRanges(this IEnumerable<string> s
4444
/// <summary>
4545
/// Retrieves the concatenated items within the specified range as one single <see langword="string"/> joined by <see cref="Environment.NewLine"/> character.
4646
/// </summary>
47-
/// <param name="source">The <see cref="IEnumerable{TData}"/> to select from.</param>
47+
/// <param name="sourceItems">The <see cref="IEnumerable{TData}"/> to select from.</param>
4848
/// <param name="range">
4949
/// A tuple containing the start and end indices of the range as <see langword="int"/>.
5050
/// The start index specifies the first item to include, and the end index specifies the last item to include.
@@ -54,28 +54,30 @@ public static IEnumerable<string> SelectItemsByRanges(this IEnumerable<string> s
5454
/// If <c>true</c>, the start and end indices are treated as 0-based; otherwise, they are treated as 1-based.
5555
/// </param>
5656
/// <returns>
57-
/// A string containing the string typed items of <paramref name="source"/> within the specified range, joined by the system's newline character.
57+
/// A <see langword="string"/> containing the Items of <paramref name="sourceItems"/> within the specified range, joined by <see cref="Environment.NewLine"/
58+
/// >.
5859
/// </returns>
59-
public static string GetItemsWithinRange(this IEnumerable<string> source, (int Start, int End) range, bool isNullBased = true) // TODO: Consider to limit int to min 0 value instead of implicit allowing negative.
60+
public static string GetItemsWithinRange(this IEnumerable<string> sourceItems, (int Start, int End) range, bool isNullBased = true) // TODO: Consider to limit int to min 0 value instead of implicit allowing negative.
6061
{
61-
if (source is null)
62+
if (sourceItems is null)
6263
{
6364
return string.Empty;
6465
}
6566

66-
var list = source as IList<string> ?? [.. source];
67+
var list = sourceItems as IList<string> ?? [.. sourceItems];
6768
if (list.Count == 0)
6869
{
6970
return string.Empty;
7071
}
7172

73+
var baseItem = isNullBased ? 0 : 1;
7274
var startIndex = Math.Clamp(
73-
value: range.Start - (isNullBased ? 0 : 1),
74-
min: 0,
75+
value: range.Start - baseItem,
76+
min: baseItem,
7577
max: list.Count);
7678

7779
var endIndex = Math.Clamp(
78-
value: range.End - (isNullBased ? 0 : 1),
80+
value: range.End - baseItem,
7981
min: startIndex,
8082
max: list.Count); // Ensure 'End' does not exceed available lines
8183

src/DevTKSS.Extensions.Uno/StorageExtensions.cs renamed to src/DevTKSS.Extensions.Uno.Storage/StorageExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ public static class StorageExtensions
77
/// <param name="storage">The storage interface used to access the file.</param>
88
/// <param name="filePath">The path of the file to read from.</param>
99
/// <param name="lineRanges">
10-
/// A collection of tuples representing the line ranges to extract.
10+
/// A collection of tuples representing the line ranges to extract.
1111
/// Each tuple contains a start line (inclusive) and an end line (inclusive).
1212
/// </param>
1313
/// <returns>
14-
/// A <see cref="ValueTask{TResult}"/> representing the asynchronous operation.
15-
/// The result contains the extracted lines joined by the system's newline character,
14+
/// A <see cref="ValueTask{string}"/> representing the asynchronous operation.
15+
/// The result contains the extracted lines joined by <see cref="Environment.NewLine"/>,
1616
/// or the entire file content if no line ranges are specified.
1717
/// </returns>
1818
public static async ValueTask<string> ReadLinesFromPackageFile(this IStorage storage, string filePath, IEnumerable<(int, int)> lineRanges)
1919
{
2020
string fileContent = await storage.ReadPackageFileAsync(filePath) ?? string.Empty;
21-
if (!(lineRanges.Any()))
21+
if (!lineRanges.Any())
2222
{
2323
return fileContent;
2424
}
File renamed without changes.

src/DevTKSS.Uno.Samples.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevTKSS.Uno.Samples.MvuxGal
1717
EndProject
1818
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevTKSS.Uno.XamlNavigationApp", "DevTKSS.Uno.XamlNavigationApp-1\DevTKSS.Uno.XamlNavigationApp.csproj", "{AE75474D-B5FC-3152-7897-AB178447428A}"
1919
EndProject
20-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevTKSS.Extensions.Uno", "DevTKSS.Extensions.Uno\DevTKSS.Extensions.Uno.csproj", "{88A95F19-AAAB-6B45-A5D7-8BABCE37F25C}"
20+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevTKSS.Extensions.Uno.Storage", "DevTKSS.Extensions.Uno.Storage\DevTKSS.Extensions.Uno.Storage.csproj", "{88A95F19-AAAB-6B45-A5D7-8BABCE37F25C}"
2121
EndProject
2222
Global
2323
GlobalSection(SolutionConfigurationPlatforms) = preSolution

src/Directory.Packages.props

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@
1010
<ItemGroup>
1111
<PackageVersion Include="CommunityToolkit.WinUI.Converters" Version="8.2.250402" />
1212
</ItemGroup>
13-
14-
<ItemGroup>
15-
<PackageVersion Include="Uno.Core" Version="4.1.1" />
16-
<PackageVersion Include="Uno.Core.Extensions" Version="4.1.1" />
17-
<PackageVersion Include="Uno.Core.Extensions.Collections" Version="4.1.1" />
18-
<PackageVersion Include="Uno.Extensions.Storage" Version="5.3.8" />
13+
<ItemGroup>
14+
<PackageVersion Include="Uno.Core" Version="4.1.1" />
15+
<PackageVersion Include="Uno.Core.Extensions" Version="4.1.1" />
16+
<PackageVersion Include="Uno.Core.Extensions.Collections" Version="4.1.1" />
17+
<PackageVersion Include="Uno.Extensions.Storage" Version="6.0.12" />
1918
</ItemGroup>
20-
</Project>
19+
</Project>

0 commit comments

Comments
 (0)