Browse Source

Remove old interop implementation

pull/3196/head
Christoph Wille 1 year ago
parent
commit
e3ec6d8e59
  1. 21
      ILSpy/TreeNodes/NaturalStringComparer.cs

21
ILSpy/TreeNodes/NaturalStringComparer.cs

@ -18,35 +18,16 @@ @@ -18,35 +18,16 @@
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using NaturalSort.Extension;
namespace ICSharpCode.ILSpy.TreeNodes
{
/// <summary>
/// .NET natural string comparison emulating .Instance behavior of original native-interop variant
/// .NET natural string comparison
/// </summary>
public sealed class NaturalStringComparer
{
public static readonly IComparer<string> Instance = StringComparison.CurrentCultureIgnoreCase.WithNaturalSort();
// public static readonly NaturalStringComparer Instance = new NaturalStringComparer();
}
#if WINDOWS
/// <summary>
/// Native-Interop natural string comparion using StrCmpLogicalW from shlwapi.dll
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1060:MovePInvokesToNativeMethodsClass")]
public sealed class NativeNaturalStringComparer : IComparer<string>
{
[DllImport("shlwapi.dll", CharSet = CharSet.Unicode)]
static extern int StrCmpLogicalW(string psz1, string psz2);
public int Compare(string x, string y)
{
return StrCmpLogicalW(x, y);
}
}
#endif
}

Loading…
Cancel
Save