private void closeServices() { if (loginService != null) { loginService.Close(); } if (factoryService != null) { factoryService.Close(); } if (simulationService != null) { simulationService.Close(); } }