mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
[PR #905] Initial refactoring of dotnet API #1349
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?
Original Pull Request: https://github.com/ElectronNET/Electron.NET/pull/905
State: closed
Merged: Yes
Currently events and tasks have a lot of repetitive code, this RP attempts to remove some of the repetition starting with events.
Changes summary
ApiEventManagerto wrap events code.App.cs,BrowserWindow.cs,Tray.cs,AutoUpdater.cs,NativeTheme.cs,PowerMonitor.cs,Screen.cs,WebContents.csTrayandScreenAPI.Different event naming and Tray API changes
Currently Electron.NET API has multiple event naming schemes making it harder to implement a single method for wrapping events, examples below. Event names in .NET API correspond to event names in TypeScript/JS implementation.
BrowserWindowAPI does not add any additional names to events.AppAPI adds-eventtoEmit()method.TrayandScreenAPI was adding-eventtoOn()method.In order to keep different method signatures to a minimum I have renamed Tray and Screen API events in line with BrowserWindow.
This is a work in progress but would like to get some feedback to make sure the change is acceptable.