protected override void OnExiting(object sender, EventArgs args) { base.OnExiting(sender, args); cn.Stop(); FDImageManager.Stop(); XXImageManager.Stop(); NHImageManager.Stop(); SHImageManager.Stop(); USImageManager.Stop(); FMImageManager.Stop(); Environment.Exit(Environment.ExitCode); }
public void Start() { Console.CancelKeyPress += delegate { UIConsole.Log("Hit Ctrl + C! Closing..."); running = false; }; UIConsole.Log("Headless Main Starting"); FDImageManager.Start(); XXImageManager.Start(); NHImageManager.Start(); SHImageManager.Start(); USImageManager.Start(); FMImageManager.Start(); UNKImageManager.Start(); cn.Start(); httpsv.Start(); running = true; while (running) { Thread.Sleep(10); } UIConsole.Log("Closing program..."); cn.Stop(); httpsv.Stop(); FDImageManager.Stop(); XXImageManager.Stop(); NHImageManager.Stop(); SHImageManager.Stop(); USImageManager.Stop(); FMImageManager.Stop(); UNKImageManager.Stop(); }