示例#1
0
        private void RunSubscribeDialog()
        {
            Uri feedUri = null;
            FeedAutoDownload syncPreference;
            string           url = null;

            PodcastSubscribeDialog subscribeDialog = new PodcastSubscribeDialog();

            ResponseType response = (ResponseType)subscribeDialog.Run();

            syncPreference = subscribeDialog.SyncPreference;
            int max_items = subscribeDialog.MaxItemCount;

            if (response == ResponseType.Ok)
            {
                url = subscribeDialog.Url.Trim().Trim('/');
            }

            subscribeDialog.Destroy();

            if (String.IsNullOrEmpty(url))
            {
                return;
            }

            Uri tweaked_feed_uri;

            if (!TryParseUrl(url, out feedUri) && !TryParseUrl("http://" + url, out tweaked_feed_uri))
            {
                HigMessageDialog.RunHigMessageDialog(
                    null,
                    DialogFlags.Modal,
                    MessageType.Warning,
                    ButtonsType.Ok,
                    Catalog.GetString("Invalid URL"),
                    Catalog.GetString("Podcast URL is invalid.")
                    );
            }
            else
            {
                SubscribeToPodcast(feedUri, syncPreference, max_items);
            }
        }
示例#2
0
        private void RunSubscribeDialog()
        {
            Uri feedUri = null;
            FeedAutoDownload syncPreference;

            PodcastSubscribeDialog subscribeDialog = new PodcastSubscribeDialog();

            ResponseType response = (ResponseType)subscribeDialog.Run();

            syncPreference = subscribeDialog.SyncPreference;

            subscribeDialog.Destroy();

            if (response == ResponseType.Ok)
            {
                string url = subscribeDialog.Url.Trim().Trim('/');

                if (String.IsNullOrEmpty(subscribeDialog.Url))
                {
                    return;
                }

                if (!TryParseUrl(url, out feedUri))
                {
                    HigMessageDialog.RunHigMessageDialog(
                        null,
                        DialogFlags.Modal,
                        MessageType.Warning,
                        ButtonsType.Ok,
                        Catalog.GetString("Invalid URL"),
                        Catalog.GetString("Podcast URL is invalid.")
                        );
                }
                else
                {
                    SubscribeToPodcast(feedUri, syncPreference);
                }
            }
        }
示例#3
0
        private void RunSubscribeDialog()
        {
            Uri feedUri = null;
            FeedAutoDownload syncPreference;
            string url = null;

            PodcastSubscribeDialog subscribeDialog = new PodcastSubscribeDialog ();

            ResponseType response = (ResponseType) subscribeDialog.Run ();

            syncPreference = subscribeDialog.SyncPreference;
            int max_items = subscribeDialog.MaxItemCount;

            if (response == ResponseType.Ok) {
                url = subscribeDialog.Url.Trim ().Trim ('/');
            }

            subscribeDialog.Destroy ();

            if (String.IsNullOrEmpty (url)) {
                return;
            }

            if (!TryParseUrl (url, out feedUri)) {
                HigMessageDialog.RunHigMessageDialog (
                    null,
                    DialogFlags.Modal,
                    MessageType.Warning,
                    ButtonsType.Ok,
                    Catalog.GetString ("Invalid URL"),
                    Catalog.GetString ("Podcast URL is invalid.")
                );
            } else {
                SubscribeToPodcast (feedUri, syncPreference, max_items);
            }
        }