Exemplo n.º 1
0
        private void xAction_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            Grid grid = sender as Grid;
            MediaFileDownload downloader = MediaFileDownload.Find(grid.Tag as string);

            if (downloader != null)
            {
                switch (downloader.Status)
                {
                case DownloadStatus.Downloading:
                case DownloadStatus.Waiting:
                    downloader.Pause();
                    break;

                case DownloadStatus.Error:
                case DownloadStatus.Paused:
                case DownloadStatus.Timeout:
                case DownloadStatus.InsufficientDiskSpace:
                {
                    _vid = downloader.Tag as string;
                    foreach (DownInfo info in MyDownloading)
                    {
                        if (info.VID == _vid)
                        {
                            info.StatusImage = "/PPTVForWP7;component/Images/Download.png";
                            break;
                        }
                    }
                    string[] id = _vid.Split('|');
                    if (string.IsNullOrEmpty(id[1]))
                    {
                        //电影
                        StartDownloadProgram(Convert.ToInt32(id[0]));
                    }
                    else
                    {
                        //剧集
                        StartDownloadProgram(Convert.ToInt32(id[2]));
                    }
                }
                break;

                default:
                    break;
                }
            }
        }