示例#1
0
        private void OnDownloadToggled(object o, ToggledArgs args)
        {
            try
            {
                CellRendererToggle renderer = (CellRendererToggle)o;

                if (!renderer.Sensitive)
                {
                    return;
                }

                TreeIter iter;

                if (!sort.GetIter(out iter, new TreePath(args.Path)))
                {
                    return;
                }

                PodcastInfo pi = sort.GetValue(iter, 0) as PodcastInfo;

                if (!pi.IsQueued)
                {
                    PodcastCore.QueuePodcastDownload(pi);
                }
                else
                {
                    PodcastCore.CancelPodcastDownload(pi);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
示例#2
0
        private void OnCancelPodcastsActivated(object sender, EventArgs args)
        {
            PodcastInfo[] podcasts = GetSelectedPodcasts();

            if (podcasts != null)
            {
                if (podcasts.Length == 1)
                {
                    PodcastCore.CancelPodcastDownload(podcasts[0]);
                }
                else if (podcasts.Length > 1)
                {
                    PodcastCore.CancelPodcastDownload(podcasts);
                }
            }
        }