Browse Source

Move GetDoubleClickTime to NativeMethods

pull/3240/head
Christoph Wille 2 years ago
parent
commit
b81569aa11
  1. 5
      ILSpy/Controls/TreeView/SharpTreeViewTextSearch.cs
  2. 3
      ILSpy/NativeMethods.cs

5
ILSpy/Controls/TreeView/SharpTreeViewTextSearch.cs

@ -32,9 +32,6 @@ namespace ICSharpCode.ILSpy.Controls.TreeView @@ -32,9 +32,6 @@ namespace ICSharpCode.ILSpy.Controls.TreeView
/// </summary>
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 @@ -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();
}
}

3
ILSpy/NativeMethods.cs

@ -26,6 +26,9 @@ namespace ICSharpCode.ILSpy @@ -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);

Loading…
Cancel
Save