[PR #920] [MERGED] feat: Add "Once" socket listener registration for one-time handlers #1353

Closed
opened 2026-01-29 16:59:52 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ElectronNET/Electron.NET/pull/920
Author: @Denny09310
Created: 11/10/2025
Status: Merged
Merged: 11/10/2025
Merged by: @FlorianRappl

Base: developHead: feature/using-once


📝 Commits (3)

  • d8062aa fix: scale factor can be a double
  • adc1e81 fix: simplified add/remove of socket listener through usage of "Once"
  • 9a0a494 fix: missing "Once" changes, rollback to "On" on Notification

📊 Changes

24 files changed (+310 additions, -750 deletions)

View changed files

📝 src/ElectronNET.API/API/ApiBase.cs (+1 -3)
📝 src/ElectronNET.API/API/App.cs (+11 -60)
📝 src/ElectronNET.API/API/AutoUpdater.cs (+39 -93)
📝 src/ElectronNET.API/API/BrowserView.cs (+3 -8)
📝 src/ElectronNET.API/API/BrowserWindow.cs (+3 -8)
📝 src/ElectronNET.API/API/Clipboard.cs (+21 -59)
📝 src/ElectronNET.API/API/CommandLine.cs (+10 -20)
📝 src/ElectronNET.API/API/Dialog.cs (+17 -34)
📝 src/ElectronNET.API/API/Dock.cs (+16 -36)
📝 src/ElectronNET.API/API/Entities/Display.cs (+1 -1)
📝 src/ElectronNET.API/API/GlobalShortcut.cs (+3 -9)
📝 src/ElectronNET.API/API/HostHook.cs (+8 -11)
📝 src/ElectronNET.API/API/IpcMain.cs (+4 -4)
📝 src/ElectronNET.API/API/NativeTheme.cs (+12 -32)
📝 src/ElectronNET.API/API/Notification.cs (+3 -8)
📝 src/ElectronNET.API/API/Process.cs (+44 -88)
📝 src/ElectronNET.API/API/Screen.cs (+18 -48)
📝 src/ElectronNET.API/API/Session.cs (+42 -112)
📝 src/ElectronNET.API/API/Shell.cs (+19 -43)
📝 src/ElectronNET.API/API/Tray.cs (+3 -9)

...and 4 more files

📄 Description

This PR updates the socket listener handling to use the already existing Once method rather than manually adding and removing event handlers. This simplifies the code and reduces unnecessary listener cleanup logic while keeping the behavior the same.


🔄 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/920 **Author:** [@Denny09310](https://github.com/Denny09310) **Created:** 11/10/2025 **Status:** ✅ Merged **Merged:** 11/10/2025 **Merged by:** [@FlorianRappl](https://github.com/FlorianRappl) **Base:** `develop` ← **Head:** `feature/using-once` --- ### 📝 Commits (3) - [`d8062aa`](https://github.com/ElectronNET/Electron.NET/commit/d8062aae001949eed40af608e53658d5cb185233) fix: scale factor can be a double - [`adc1e81`](https://github.com/ElectronNET/Electron.NET/commit/adc1e81743ebd9d51425fab7aa1ff74890079b9e) fix: simplified add/remove of socket listener through usage of "Once" - [`9a0a494`](https://github.com/ElectronNET/Electron.NET/commit/9a0a494bc5c229e0a6c7d6737c3dc9d93cd3ca2d) fix: missing "Once" changes, rollback to "On" on Notification ### 📊 Changes **24 files changed** (+310 additions, -750 deletions) <details> <summary>View changed files</summary> 📝 `src/ElectronNET.API/API/ApiBase.cs` (+1 -3) 📝 `src/ElectronNET.API/API/App.cs` (+11 -60) 📝 `src/ElectronNET.API/API/AutoUpdater.cs` (+39 -93) 📝 `src/ElectronNET.API/API/BrowserView.cs` (+3 -8) 📝 `src/ElectronNET.API/API/BrowserWindow.cs` (+3 -8) 📝 `src/ElectronNET.API/API/Clipboard.cs` (+21 -59) 📝 `src/ElectronNET.API/API/CommandLine.cs` (+10 -20) 📝 `src/ElectronNET.API/API/Dialog.cs` (+17 -34) 📝 `src/ElectronNET.API/API/Dock.cs` (+16 -36) 📝 `src/ElectronNET.API/API/Entities/Display.cs` (+1 -1) 📝 `src/ElectronNET.API/API/GlobalShortcut.cs` (+3 -9) 📝 `src/ElectronNET.API/API/HostHook.cs` (+8 -11) 📝 `src/ElectronNET.API/API/IpcMain.cs` (+4 -4) 📝 `src/ElectronNET.API/API/NativeTheme.cs` (+12 -32) 📝 `src/ElectronNET.API/API/Notification.cs` (+3 -8) 📝 `src/ElectronNET.API/API/Process.cs` (+44 -88) 📝 `src/ElectronNET.API/API/Screen.cs` (+18 -48) 📝 `src/ElectronNET.API/API/Session.cs` (+42 -112) 📝 `src/ElectronNET.API/API/Shell.cs` (+19 -43) 📝 `src/ElectronNET.API/API/Tray.cs` (+3 -9) _...and 4 more files_ </details> ### 📄 Description This PR updates the socket listener handling to use the already existing `Once` method rather than manually adding and removing event handlers. This simplifies the code and reduces unnecessary listener cleanup logic while keeping the behavior the same. --- <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:59:53 +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#1353