Skip to content

Commit c269b99

Browse files
DllImport to LibraryImport in SharpTreeView
1 parent cc421d9 commit c269b99

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

ILSpy/NativeMethods.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ internal static partial class NativeMethods
2626
{
2727
const int S_OK = 0;
2828

29-
[LibraryImport("dwmapi.dll", EntryPoint = "DwmSetWindowAttribute")]
29+
[LibraryImport("dwmapi.dll")]
3030
internal static partial int DwmSetWindowAttribute(IntPtr hwnd, DwmWindowAttribute attr, ref int attrValue, int attrSize);
3131

3232
public static bool UseImmersiveDarkMode(IntPtr hWnd, bool enable)

SharpTreeView/ICSharpCode.TreeView.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<TargetFramework>net8.0-windows</TargetFramework>
99
<AssemblyOriginatorKeyFile>..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.snk</AssemblyOriginatorKeyFile>
1010
<EnableWindowsTargeting>true</EnableWindowsTargeting>
11+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1112
</PropertyGroup>
1213

1314
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">

SharpTreeView/SharpTreeViewTextSearch.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ namespace ICSharpCode.TreeView
2828
/// Custom TextSearch-implementation.
2929
/// Fixes #67 - Moving to class member in tree view by typing in first character of member name selects parent assembly
3030
/// </summary>
31-
public class SharpTreeViewTextSearch : DependencyObject
31+
public partial class SharpTreeViewTextSearch : DependencyObject
3232
{
33-
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
34-
static extern int GetDoubleClickTime();
33+
[LibraryImport("user32.dll")]
34+
internal static partial int GetDoubleClickTime();
3535

3636
static readonly DependencyPropertyKey TextSearchInstancePropertyKey = DependencyProperty.RegisterAttachedReadOnly("TextSearchInstance",
3737
typeof(SharpTreeViewTextSearch), typeof(SharpTreeViewTextSearch), new FrameworkPropertyMetadata(null));

0 commit comments

Comments
 (0)