private void btnAction_Click(object sender, EventArgs e) { switch (DownloadState) { case DownloadStateEnum.Available: _server.DownloadData(WebAddress, AppDomain.CurrentDomain.BaseDirectory + "Handouts/" + _id + " - " + Title); DownloadState = DownloadStateEnum.Downloading; break; case DownloadStateEnum.Downloading: _server.CancelAsync(); DownloadState = DownloadStateEnum.Available; break; case DownloadStateEnum.Downloaded: System.Diagnostics.Process.Start(AppDomain.CurrentDomain.BaseDirectory + "Handouts/" + _id + " - " + Title); break; } }