fix event names for when there are more than one window, view or webcontent Id

This commit is contained in:
theolivenbaum
2021-08-24 05:31:46 +02:00
parent fb99dbd5b5
commit 953f1e2641
10 changed files with 171 additions and 136 deletions

View File

@@ -113,7 +113,7 @@ namespace ElectronNET.API
/// <returns>printers</returns>
public Task<PrinterInfo[]> GetPrintersAsync()
{
return BridgeConnector.OnResult<PrinterInfo[]>("webContents-getPrinters", "webContents-getPrinters-completed", Id);
return BridgeConnector.OnResult<PrinterInfo[]>("webContents-getPrinters", "webContents-getPrinters-completed" + Id, Id);
}
/// <summary>
@@ -121,8 +121,8 @@ namespace ElectronNET.API
/// </summary>
/// <param name="options"></param>
/// <returns>success</returns>
public Task<bool> PrintAsync(PrintOptions options = null) => options is null ? BridgeConnector.OnResult<bool>("webContents-print", "webContents-print-completed", Id, "")
: BridgeConnector.OnResult<bool>("webContents-print", "webContents-print-completed", Id, options);
public Task<bool> PrintAsync(PrintOptions options = null) => options is null ? BridgeConnector.OnResult<bool>("webContents-print", "webContents-print-completed" + Id, Id, "")
: BridgeConnector.OnResult<bool>("webContents-print", "webContents-print-completed" + Id, Id, options);
/// <summary>
/// Prints window's web page as PDF with Chromium's preview printing custom
@@ -133,8 +133,8 @@ namespace ElectronNET.API
/// <param name="path"></param>
/// <param name="options"></param>
/// <returns>success</returns>
public Task<bool> PrintToPDFAsync(string path, PrintToPDFOptions options = null) => options is null ? BridgeConnector.OnResult<bool>("webContents-printToPDF", "webContents-printToPDF-completed", Id, "", path)
: BridgeConnector.OnResult<bool>("webContents-printToPDF", "webContents-printToPDF-completed", Id, options, path);
public Task<bool> PrintToPDFAsync(string path, PrintToPDFOptions options = null) => options is null ? BridgeConnector.OnResult<bool>("webContents-printToPDF", "webContents-printToPDF-completed" + Id, Id, "", path)
: BridgeConnector.OnResult<bool>("webContents-printToPDF", "webContents-printToPDF-completed" + Id, Id, options, path);
/// <summary>
/// Is used to get the Url of the loaded page.