forked from VerifyTests/DiffEngine
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDirectoryLauncher.cs
41 lines (40 loc) · 954 Bytes
/
DirectoryLauncher.cs
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
34
35
36
37
38
39
40
41
static class ExplorerLauncher
{
public static void OpenDirectory(string directory)
{
var info = new ProcessStartInfo
{
FileName = directory,
UseShellExecute = true,
Verb = "open"
};
try
{
using (Process.Start(info))
{
}
}
catch (Exception exception)
{
ExceptionHandler.Handle($"Failed to open directory: {directory}", exception);
}
}
public static void ShowFileInExplorer(string file)
{
var info = new ProcessStartInfo
{
FileName = "explorer.exe",
Arguments = $"/select, \"{file}\""
};
try
{
using (Process.Start(info))
{
}
}
catch (Exception exception)
{
ExceptionHandler.Handle($"Failed to open file: {file}", exception);
}
}
}