Shell.ShowItemInFolder API fix for Electron 9.0.0

This commit is contained in:
Konstantin Gross
2020-05-26 15:11:22 +02:00
parent 58ab180c94
commit 0329530815
4 changed files with 9 additions and 12 deletions

View File

@@ -40,17 +40,14 @@ namespace ElectronNET.API
/// <summary>
/// Show the given file in a file manager. If possible, select the file.
/// </summary>
/// <param name="fullPath"></param>
/// <returns>Whether the item was successfully shown.</returns>
public Task<bool> ShowItemInFolderAsync(string fullPath)
/// <param name="fullPath">The full path to the directory / file.</param>
public Task ShowItemInFolderAsync(string fullPath)
{
var taskCompletionSource = new TaskCompletionSource<bool>();
var taskCompletionSource = new TaskCompletionSource<object>();
BridgeConnector.Socket.On("shell-showItemInFolderCompleted", (success) =>
BridgeConnector.Socket.On("shell-showItemInFolderCompleted", () =>
{
BridgeConnector.Socket.Off("shell-showItemInFolderCompleted");
taskCompletionSource.SetResult((bool)success);
});
BridgeConnector.Socket.Emit("shell-showItemInFolder", fullPath);