[PR #528] [MERGED] Issue/527 #1203

Open
opened 2026-01-29 16:58:22 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ElectronNET/Electron.NET/pull/528
Author: @danatcofo
Created: 1/19/2021
Status: Merged
Merged: 1/21/2021
Merged by: @GregorBiswanger

Base: masterHead: issue/527


📝 Commits (7)

  • 3ef44cf Merge remote-tracking branch 'ElectronNET/master'
  • 12f5eae Expose Electron members to the service provider
  • ce0f3fd Dock Menu support
  • 300dc49 Update the buildAll.sh so that you can run it successfully on a Mac
  • 6076c72 By blow fix of documentation
  • e941965 Support subscribing to unmapped events on App and Tray modules
  • 8a0276d Add ability to enable remote module in browser

📊 Changes

20 files changed (+480 additions, -33 deletions)

View changed files

📝 .gitignore (+3 -0)
📝 ElectronNET.API/App.cs (+30 -0)
📝 ElectronNET.API/Dock.cs (+30 -4)
📝 ElectronNET.API/Entities/WebPreferences.cs (+7 -1)
ElectronNET.API/Events.cs (+105 -0)
ElectronNET.API/ServiceCollectionExtensions.cs (+33 -0)
📝 ElectronNET.API/Tray.cs (+30 -0)
📝 ElectronNET.Host/api/app.js (+20 -0)
📝 ElectronNET.Host/api/app.js.map (+1 -1)
📝 ElectronNET.Host/api/app.ts (+20 -0)
📝 ElectronNET.Host/api/dock.js (+18 -2)
📝 ElectronNET.Host/api/dock.js.map (+1 -1)
📝 ElectronNET.Host/api/dock.ts (+24 -3)
📝 ElectronNET.Host/api/tray.js (+24 -0)
📝 ElectronNET.Host/api/tray.js.map (+1 -1)
📝 ElectronNET.Host/api/tray.ts (+24 -0)
📝 ElectronNET.WebApp/Startup.cs (+53 -0)
📝 ElectronNET.sln (+4 -1)
📝 README.md (+14 -1)
📝 buildAll.sh (+38 -18)

📄 Description

This PR contains a couple different things separated out int different commits.

  • Extension Method for adding the Electron static class members to the standard MS DI Containers, this is a QOL issue only.
  • Documentation fix for #500 as it was right there in my face
  • SetMenu completed for the Dock (MacOS)
  • On and Once implementations for the App and Tray to cover the plethora of events that are not mapped explicitly in those two modules.
  • Adding the EnableRemoteModule property to the WebPreferences object. As of Electron 10, this property defaulted to false and without it exposed you can't use the remote module within a window.

Example for the Dock Menu

Electron.Dock.SetMenu(new [] {
   new MenuItem {
      Label = "Dock Menu Item",
      Click = () => {
         // do something
      }
   },
});

Example for consuming the activate event (MacOs only)

Electron.App.On("activate", obj => {
   var hasWindows = (bool)obj;
   // do something
});

fix #500
fix #527


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ElectronNET/Electron.NET/pull/528 **Author:** [@danatcofo](https://github.com/danatcofo) **Created:** 1/19/2021 **Status:** ✅ Merged **Merged:** 1/21/2021 **Merged by:** [@GregorBiswanger](https://github.com/GregorBiswanger) **Base:** `master` ← **Head:** `issue/527` --- ### 📝 Commits (7) - [`3ef44cf`](https://github.com/ElectronNET/Electron.NET/commit/3ef44cf87811ec4d0d4e7b3f460e764dcbe8d969) Merge remote-tracking branch 'ElectronNET/master' - [`12f5eae`](https://github.com/ElectronNET/Electron.NET/commit/12f5eae65c0e4637368b71bfe738885cdee45c09) Expose Electron members to the service provider - [`ce0f3fd`](https://github.com/ElectronNET/Electron.NET/commit/ce0f3fd61e41066b0790270e0ad22c739e7079e4) Dock Menu support - [`300dc49`](https://github.com/ElectronNET/Electron.NET/commit/300dc49dde4b9a295b221bffcedb57d374a09fc3) Update the buildAll.sh so that you can run it successfully on a Mac - [`6076c72`](https://github.com/ElectronNET/Electron.NET/commit/6076c727d12b7c90bc420c2b3585e50eeec3b645) By blow fix of documentation - [`e941965`](https://github.com/ElectronNET/Electron.NET/commit/e94196504e5282a8c221eb4caf801091744be7a5) Support subscribing to unmapped events on App and Tray modules - [`8a0276d`](https://github.com/ElectronNET/Electron.NET/commit/8a0276daf971521f5eae580d1a35910a54f21223) Add ability to enable remote module in browser ### 📊 Changes **20 files changed** (+480 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+3 -0) 📝 `ElectronNET.API/App.cs` (+30 -0) 📝 `ElectronNET.API/Dock.cs` (+30 -4) 📝 `ElectronNET.API/Entities/WebPreferences.cs` (+7 -1) ➕ `ElectronNET.API/Events.cs` (+105 -0) ➕ `ElectronNET.API/ServiceCollectionExtensions.cs` (+33 -0) 📝 `ElectronNET.API/Tray.cs` (+30 -0) 📝 `ElectronNET.Host/api/app.js` (+20 -0) 📝 `ElectronNET.Host/api/app.js.map` (+1 -1) 📝 `ElectronNET.Host/api/app.ts` (+20 -0) 📝 `ElectronNET.Host/api/dock.js` (+18 -2) 📝 `ElectronNET.Host/api/dock.js.map` (+1 -1) 📝 `ElectronNET.Host/api/dock.ts` (+24 -3) 📝 `ElectronNET.Host/api/tray.js` (+24 -0) 📝 `ElectronNET.Host/api/tray.js.map` (+1 -1) 📝 `ElectronNET.Host/api/tray.ts` (+24 -0) 📝 `ElectronNET.WebApp/Startup.cs` (+53 -0) 📝 `ElectronNET.sln` (+4 -1) 📝 `README.md` (+14 -1) 📝 `buildAll.sh` (+38 -18) </details> ### 📄 Description This PR contains a couple different things separated out int different commits. * Extension Method for adding the Electron static class members to the standard MS DI Containers, this is a QOL issue only. * Documentation fix for #500 as it was right there in my face * SetMenu completed for the Dock (MacOS) * On and Once implementations for the App and Tray to cover the plethora of events that are not mapped explicitly in those two modules. * Adding the `EnableRemoteModule` property to the WebPreferences object. As of Electron 10, this property defaulted to false and without it exposed you can't use the remote module within a window. Example for the Dock Menu ```csharp Electron.Dock.SetMenu(new [] { new MenuItem { Label = "Dock Menu Item", Click = () => { // do something } }, }); ``` Example for consuming the `activate` event (MacOs only) ```csharp Electron.App.On("activate", obj => { var hasWindows = (bool)obj; // do something }); ``` fix #500 fix #527 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 16:58:22 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#1203