-
-
This commit is contained in:
17
mpvnet/Misc.cs
Normal file
17
mpvnet/Misc.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user