mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-14 21:24:58 +00:00
fix: added usings, simplified imports, using JsonElement.Deserialize directly instead of JsonSerializer.Deserialize(JsonElement), removed some unused attributes
This commit is contained in:
@@ -101,7 +101,7 @@ public class WebContents
|
||||
/// </summary>
|
||||
public event Action<OnDidFailLoadInfo> OnDidFailLoad
|
||||
{
|
||||
add => ApiEventManager.AddEvent("webContents-didFailLoad", Id, _didFailLoad, value, (args) => JsonSerializer.Deserialize<OnDidFailLoadInfo>(args, ElectronJson.Options));
|
||||
add => ApiEventManager.AddEvent("webContents-didFailLoad", Id, _didFailLoad, value, (args) => args.Deserialize<OnDidFailLoadInfo>(ElectronJson.Options));
|
||||
remove => ApiEventManager.RemoveEvent("webContents-didFailLoad", Id, _didFailLoad, value);
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ public class WebContents
|
||||
/// </summary>
|
||||
public event Action<InputEvent> InputEvent
|
||||
{
|
||||
add => ApiEventManager.AddEvent("webContents-input-event", Id, _inputEvent, value, (args) => JsonSerializer.Deserialize<InputEvent>(args, ElectronJson.Options));
|
||||
add => ApiEventManager.AddEvent("webContents-input-event", Id, _inputEvent, value, (args) => args.Deserialize<InputEvent>(ElectronJson.Options));
|
||||
remove => ApiEventManager.RemoveEvent("webContents-input-event", Id, _inputEvent, value);
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ public class WebContents
|
||||
{
|
||||
BridgeConnector.Socket.Off("webContents-getPrinters-completed");
|
||||
|
||||
taskCompletionSource.SetResult(JsonSerializer.Deserialize<PrinterInfo[]>(printers, ElectronJson.Options));
|
||||
taskCompletionSource.SetResult(printers.Deserialize<PrinterInfo[]>(ElectronJson.Options));
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("webContents-getPrinters", Id);
|
||||
|
||||
Reference in New Issue
Block a user