void Run() { while (running) { agent.Fire(); Thread.Sleep(1000); } }
/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { if (args.Length == 0) { ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new PersistentStorageAgentService() }; ServiceBase.Run(ServicesToRun); } else { PersistentStorageAgent p = new PersistentStorageAgent(); p.Fire(); } }