forked from Devolutions/UniGetUI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFolderPicker.cs
More file actions
33 lines (29 loc) · 871 Bytes
/
FolderPicker.cs
File metadata and controls
33 lines (29 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using ExternalLibraries.Pickers.Classes;
using ExternalLibraries.Pickers.Enums;
namespace ExternalLibraries.Pickers;
/// <summary>
/// Class responsible for folder pick dialog.
/// </summary>
public class FolderPicker
{
/// <summary>
/// Window handle where dialog should appear.
/// </summary>
private readonly IntPtr _windowHandle;
/// <summary>
/// Folder pick dialog.
/// </summary>
/// <param name="windowHandle">Window handle where dialog should appear.</param>
public FolderPicker(IntPtr windowHandle)
{
_windowHandle = windowHandle;
}
/// <summary>
/// Shows folder pick dialog.
/// </summary>
/// <returns>Path to selected folder or empty string.</returns>
public string Show()
{
return Helper.ShowOpen(_windowHandle, FOS.FOS_PICKFOLDERS | FOS.FOS_FORCEFILESYSTEM);
}
}