Hello.
Is there a method that let's me check for the current process in my code?
I need to do some stuff only on the browser process. The problem right now is that code gets executed on browser and renderer process.
I need to execute some code only on the browser code.
Here is more info on the scenario:
I have a static class ( class with static members ) that is my data model. The data is updated in the browser process but not in the renderer process ( because I am not sending the renderer process this data ).
The data model fires events depending on its changes and I create an object that subscribes to these events. This object is created in the browser AND the renderer process, which is not what I want. I want only the browser process to subscribe to the events of the data model.
If I could have something like if(CurrentProcess == BrowserProcess){...} then I think I'd be fine.
Thanks in advance.
EDIT: I know I can check for CEF Threads, but I am running threads besides CEF ( WinForms runs it's own thread I think and I also do some networking stuff and listening in another thread ). Also I can't check for the Renderer Thread, because I get an exception if I do that in the browser process.