Skip to content

Commit

Permalink
Use NaturalSort.Extension instead of Interop
Browse files Browse the repository at this point in the history
  • Loading branch information
christophwille committed Apr 8, 2024
1 parent 38e7ab4 commit 4998375
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<PackageVersion Include="Microsoft.VisualStudio.Composition" Version="17.7.40" />
<PackageVersion Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.77" />
<PackageVersion Include="Mono.Cecil" Version="0.11.5" />
<PackageVersion Include="NaturalSort.Extension" Version="4.2.0" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="NSubstitute.Analyzers.CSharp" Version="1.0.17" />
<PackageVersion Include="NUnit" Version="4.1.0" />
Expand Down
1 change: 1 addition & 0 deletions ILSpy/ILSpy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<PackageReference Include="Microsoft.VisualStudio.Composition" />
<PackageReference Include="DataGridExtensions" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" />
<PackageReference Include="NaturalSort.Extension" />
<PackageReference Include="TomsToolbox.Wpf.Styles" />
</ItemGroup>

Expand Down
7 changes: 6 additions & 1 deletion ILSpy/TreeNodes/NaturalStringComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;

using NaturalSort.Extension;

namespace ICSharpCode.ILSpy.TreeNodes
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1060:MovePInvokesToNativeMethodsClass")]
Expand All @@ -27,7 +31,8 @@ public sealed class NaturalStringComparer : IComparer<string>
[DllImport("shlwapi.dll", CharSet = CharSet.Unicode)]
static extern int StrCmpLogicalW(string psz1, string psz2);

public static readonly NaturalStringComparer Instance = new NaturalStringComparer();
// public static readonly NaturalStringComparer Instance = new NaturalStringComparer();
public static readonly IComparer<string> Instance = StringComparison.OrdinalIgnoreCase.WithNaturalSort();

public int Compare(string x, string y)
{
Expand Down

0 comments on commit 4998375

Please sign in to comment.