private void exitAppBtn_Click(object sender, EventArgs e) { if (_ShouldExitApp()) { _webClientService.StopDownload(); _appFileService.SaveFile(programDownloadList.Items.Cast <DownloadableProgram>().ToList(), UtilClass.FormatDirectoryPathAndAddFileToPath(_appCurrentDirectory, Constants.ConfigurationFile)); Application.Exit(); } }