From b81569aa1121a5fdc7176060b4ec59aaa76f4af6 Mon Sep 17 00:00:00 2001 From: Christoph Wille Date: Sun, 28 Jul 2024 14:58:39 +0200 Subject: [PATCH] Move GetDoubleClickTime to NativeMethods --- ILSpy/Controls/TreeView/SharpTreeViewTextSearch.cs | 5 +---- ILSpy/NativeMethods.cs | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ILSpy/Controls/TreeView/SharpTreeViewTextSearch.cs b/ILSpy/Controls/TreeView/SharpTreeViewTextSearch.cs index f48638359..731744c14 100644 --- a/ILSpy/Controls/TreeView/SharpTreeViewTextSearch.cs +++ b/ILSpy/Controls/TreeView/SharpTreeViewTextSearch.cs @@ -32,9 +32,6 @@ namespace ICSharpCode.ILSpy.Controls.TreeView /// public partial class SharpTreeViewTextSearch : DependencyObject { - [LibraryImport("user32.dll")] - internal static partial int GetDoubleClickTime(); - static readonly DependencyPropertyKey TextSearchInstancePropertyKey = DependencyProperty.RegisterAttachedReadOnly("TextSearchInstance", typeof(SharpTreeViewTextSearch), typeof(SharpTreeViewTextSearch), new FrameworkPropertyMetadata(null)); static readonly DependencyProperty TextSearchInstanceProperty = TextSearchInstancePropertyKey.DependencyProperty; @@ -169,7 +166,7 @@ namespace ICSharpCode.ILSpy.Controls.TreeView { timer.Stop(); } - timer.Interval = TimeSpan.FromMilliseconds(GetDoubleClickTime() * 2); + timer.Interval = TimeSpan.FromMilliseconds(NativeMethods.GetDoubleClickTime() * 2); timer.Start(); } } diff --git a/ILSpy/NativeMethods.cs b/ILSpy/NativeMethods.cs index a5c0cea62..0d8aa8cb1 100644 --- a/ILSpy/NativeMethods.cs +++ b/ILSpy/NativeMethods.cs @@ -26,6 +26,9 @@ namespace ICSharpCode.ILSpy { const int S_OK = 0; + [LibraryImport("user32.dll")] + internal static partial int GetDoubleClickTime(); + [LibraryImport("dwmapi.dll")] internal static partial int DwmSetWindowAttribute(IntPtr hwnd, DwmWindowAttribute attr, ref int attrValue, int attrSize);