private void ButtonPlay_Click()
{
int epid = Convert.ToInt32(this.ListDownloads.SelectedItems[0].Name, CultureInfo.InvariantCulture);
Model.Download info = new Model.Download(epid);
if (info.Status == Model.Download.DownloadStatus.Downloaded)
{
if (File.Exists(info.DownloadPath))
{
try
{
Process.Start(info.DownloadPath);
}
catch (System.ComponentModel.Win32Exception playExp)
{
MessageBox.Show("Failed to play the download: " + playExp.Message + ". Check your file associations for " + Path.GetExtension(info.DownloadPath) + " files and try again.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
// Bump the play count of this item up by one
Model.Download.BumpPlayCount(epid);
}
}
}