replace v6 with experimental v7 code

This commit is contained in:
stax76
2023-10-24 11:17:45 +02:00
parent fb27bb8727
commit 5706d7b66d
212 changed files with 15014 additions and 12173 deletions

View File

@@ -0,0 +1,17 @@

using System.Runtime.InteropServices;
using System.Collections;
namespace MpvNet.Native;
public class StringLogicalComparer : IComparer, IComparer<string>
{
[DllImport("shlwapi.dll", CharSet = CharSet.Unicode)]
static extern int StrCmpLogical(string? x, string? y);
static int IComparer_Compare(object? x, object? y) => StrCmpLogical(x!.ToString(), y!.ToString());
static int IComparerOfString_Compare(string? x, string? y) => StrCmpLogical(x, y);
int IComparer.Compare(object? x, object? y) => IComparer_Compare(x, y);
int IComparer<string>.Compare(string? x, string? y) => IComparerOfString_Compare(x, y);
}