-
-
Notifications
You must be signed in to change notification settings - Fork 744
feat: Add ElectronHostHook sample application (#967) #968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add ElectronHostHook sample application (#967) #968
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new sample application demonstrating the ElectronHostHook functionality, which enables bidirectional communication between C# and the Electron host process via TypeScript/JavaScript.
Key Changes
- New sample project showcasing
ping/pongcommunication between C# (HomeController) and TypeScript (ElectronHostHook/index.ts) - Implementation of custom
Connectorclass to handle socket-based communication - Integration into the solution under "Test Apps" folder alongside existing samples
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
src/ElectronNET.sln |
Adds new sample project with proper dependencies and solution folder nesting |
src/ElectronNET.Samples.ElectronHostHook/ElectronNET.Samples.ElectronHostHook.csproj |
Project configuration with TypeScript compilation and ElectronNET references |
src/ElectronNET.Samples.ElectronHostHook/Program.cs |
ASP.NET Core application setup with Electron integration |
src/ElectronNET.Samples.ElectronHostHook/Controllers/HomeController.cs |
Controller demonstrating HostHook.CallAsync usage |
src/ElectronNET.Samples.ElectronHostHook/Views/Home/Index.cshtml |
Simple UI displaying communication results |
src/ElectronNET.Samples.ElectronHostHook/ElectronHostHook/connector.ts |
Base connector class for socket communication (has critical bug) |
src/ElectronNET.Samples.ElectronHostHook/ElectronHostHook/index.ts |
HookService implementation with ping event handler |
src/ElectronNET.Samples.ElectronHostHook/ElectronHostHook/tsconfig.json |
TypeScript compiler configuration |
src/ElectronNET.Samples.ElectronHostHook/Properties/launchSettings.json |
Development launch configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/ElectronNET.Samples.ElectronHostHook/ElectronHostHook/connector.ts
Outdated
Show resolved
Hide resolved
src/ElectronNET.Samples.ElectronHostHook/Views/Home/Index.cshtml
Outdated
Show resolved
Hide resolved
src/ElectronNET.Samples.ElectronHostHook/ElectronHostHook/tsconfig.json
Outdated
Show resolved
Hide resolved
|
@adityashirsatrao007 - Wow, cool! That was fast (after I posted the issue at least).. I think we need to determine a number of conventions for how to include the samples in the repo. The existing test apps are meant for development. They have project files that allow them to consume all of Electron.NET directly, bypassing nuget packages (unless modified). The folder name should be the subject without prefix, i.e. in this case As a 3-part root namespace is a bit ugly, I'd suggest that all samples should have two parts
So, the full paths would be:
But please don't take my word for it and don't make any changes yet. |
|
@adityashirsatrao007 - Thanks for implementing all the Copilot suggestions I've marked them as resolved. We're just waiting for input from @FlorianRappl now. |
|
I think we can stay with the 3-part solution (yes it's ugly, but it has the arguably "correct" hierarchy). Let's merge it in like that. Thanks a lot for the effort! 🚀 |
Closes #967
Changes
Details
This addresses the request for a focused 'ElectronHostHook Sample' in the linked issue. The sample is minimal and self-contained, showing only the hook mechanism.