Skip to content

Commit 58552ac

Browse files
authored
Code Quality: Merge P/Invoke into single partial class (#15075)
1 parent fd57b28 commit 58552ac

23 files changed

+494
-411
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright (c) 2024 Files Community
2+
// Licensed under the MIT License. See the LICENSE.
3+
4+
using System.Runtime.InteropServices;
5+
6+
namespace Files.App.Data.Contracts
7+
{
8+
[ComImport]
9+
[Guid("3A3DCD6C-3EAB-43DC-BCDE-45671CE800C8")]
10+
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
11+
interface IDataTransferManagerInterop
12+
{
13+
IntPtr GetForWindow([In] IntPtr appWindow, [In] ref Guid riid);
14+
15+
void ShowShareUIForWindow(IntPtr appWindow);
16+
}
17+
}

src/Files.App/Data/Models/AppModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public string PCloudDrivePath
121121
/// Gets or sets a value indicating the AppWindow DPI.
122122
/// TODO update value if the DPI changes
123123
/// </summary>
124-
private float _AppWindowDPI = InteropHelpers.GetDpiForWindow(MainWindow.Instance.WindowHandle) / 96f;
124+
private float _AppWindowDPI = Win32PInvoke.GetDpiForWindow(MainWindow.Instance.WindowHandle) / 96f;
125125
public float AppWindowDPI
126126
{
127127
get => _AppWindowDPI;

src/Files.App/Data/Models/ItemViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
using Windows.Storage;
1919
using Windows.Storage.FileProperties;
2020
using Windows.Storage.Search;
21-
using static Files.App.Helpers.NativeDirectoryChangesHelper;
21+
using static Files.App.Helpers.Win32PInvoke;
2222
using static Files.Core.Helpers.NativeFindStorageItemHelper;
2323
using DispatcherQueue = Microsoft.UI.Dispatching.DispatcherQueue;
2424
using FileAttributes = System.IO.FileAttributes;

src/Files.App/Data/Models/RemovableDevice.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System;
55
using System.Diagnostics;
66
using System.Threading.Tasks;
7-
using static Files.App.Helpers.NativeIoDeviceControlHelper;
7+
using static Files.App.Helpers.Win32PInvoke;
88

99
namespace Files.App.Data.Models
1010
{

src/Files.App/Helpers/Interop/FileUtils.cs

Lines changed: 0 additions & 145 deletions
This file was deleted.

src/Files.App/Helpers/Interop/InteropHelpers.cs

Lines changed: 0 additions & 107 deletions
This file was deleted.

src/Files.App/Helpers/Interop/NativeDirectoryChangesHelper.cs

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)