mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-04 05:34:51 +00:00
Electron.IpcMain.Send and Arrays (in Electron.Net Api Demos) #314
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @KinNeko-De on GitHub (May 20, 2019).
Hello,
i am new to Electron.Net and have a question. I am not very familar with javascript btw.
I used the Electron.Net Api Demos to open a file dialog that allows multiple selection.
I nearly copied everything from DialogsController.
string[] files = await Electron.Dialog.ShowOpenDialogAsync(mainWindow, options); Electron.IpcMain.Send(mainWindow, "select-directory-reply", files);files is an array.
I expected to get an array on the javascript side too.
But i only get a string. The related javascript code in the example expect only a single path.
The code in IpcMain goes over the array and creates multiple objects.
I think it was designed to do so. Right?
After i debugged the IpcMain code i decide to use :
'Electron.IpcMain.Send(mainWindow, "select-directory-reply", new object[] { files });'
Is that the simplest solution or do i miss something?
Should the example be edited to make it clearer how parameters should be passed?