Question

I currently have a winforms app running the quartz .net engine and I have a self Hosted HTTP engine inside the APP.

I got my windows service example from here: http://www.codeproject.com/Articles/14353/Creating-a-Basic-Windows-Service-in-C

My quartz is loosely based on examples here: http://quartznet.sourceforge.net/tutorial/index.html

How would i have the Hosted Quartz, Windows Service, Winforms Element and Self Hosted HTTP run together but independently. I.e. I will I need to access things on different threads.

I.e. I want to call quartz to get list of current jobs from my form, windows service and web host.

Was it helpful?

Solution

I had a go at this last night and I achieved this in the following way:

  1. Setup a class that inherited ServiceBase as my entry point.
  2. Had a check in the startup to see if (Interactive=true) if true then I displayed my windows form, else I ran as service.
  3. The web server class is instantiated from the main class thats inherits ServiceBase and talks to each other via events.
  4. The windows form interacts with my main class to give the same sort of output that the web server module does.
  5. The quartz was instantiated from my main class also, and I have routines inside this class for getting state values, running jobs, and event handlers for running new jobs.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top