17 lines
685 B
C#
17 lines
685 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace mpvnet
|
|
{
|
|
public class StringLogicalComparer : IComparer, IComparer<string>
|
|
{
|
|
[DllImport("shlwapi.dll", CharSet = CharSet.Unicode)]
|
|
public static extern int StrCmpLogical(string x, string y);
|
|
|
|
int IComparer_Compare(object x, object y) => StrCmpLogical(x.ToString(), y.ToString());
|
|
int IComparer.Compare(object x, object y) => IComparer_Compare(x, y);
|
|
int IComparerOfString_Compare(string x, string y) => StrCmpLogical(x, y);
|
|
int IComparer<string>.Compare(string x, string y) => IComparerOfString_Compare(x, y);
|
|
}
|
|
} |