Electronic graphical interface with C # support

Use case

I have an existing project developed in C # using WinForms with customizable GUI controls. We are amazed at the approach to writing GUIs using HTML / CSS / JS, and we are looking for the best way to write a GUI for our desktop application using the above languages. We only need to support Windows devices.

My worries:

You do not need to meet with recommendations using the electronic edge for a long time. Although I'm not so worried that everything works, it bothers me:

  • Debugging my C # code (I still want to be able to run my entire application directly from VS and debug it, I'm used to it). I read that I will need to connect to the node.js application in order to subsequently debug my C # code. So how is the whole programming language written in C #, which sounds like pain?
  • As I understand it, it will work as one process. Can I consider an electronic application as a native thread that will still work while my C # code is stuck somewhere?

My option:

I'm still sure I want to write my desktop GUI using HTML / CSS / JS. What I considered instead of using the electronic edge is to write my own electronic application that communicates with my C # backend using named pipes. I wonder if there are larger checkpoints, why wouldn’t I want to do this and would instead use the electronic edge?

My question is:

I would like to receive feedback on my two problems mentioned above, and also would like to receive information about my option to create a GUI as my own electronic process, so I have two processes (GUI + Backend) when someone starts my application .

+10
source share
1 answer

You can do it in many ways.

1) COM. Create C # COM DLL. Create wrapper functions for the DLL using the N-API (native node module) or use FFI. You can access functions from JS.

2) Create a .Net web server and enable your features as REST endpoints. From the user interface, make an http request for communication (Clear separation of user interface and BEnd)

You can check out my github repository for several alternatives to electron.

0
source

Source: https://habr.com/ru/post/1270700/


All Articles