Ejemplo n.º 1
0
 public bool Add(PodcastSubscription subscription)
 {
     if (!this.Dictionary.ContainsKey(subscription.Url))
     {
         base.Add(subscription);
         return true;
     }
     return false;
 }
Ejemplo n.º 2
0
        public Podcast(PodcastSubscription subscription)
            : base(subscription.Name)
        {
            this.Text = subscription.Name;
            this.Url = subscription.Url;

            this.Icon = new NodeIcon("podcast", Assets.Images.Icons.Png._16.podcast);

            this.Menu.Add("markasread", new ToolStripMenuItem(i18n.MarkAsRead, Assets.Images.Icons.Png._16.read, new EventHandler(MenuMarkAllAsReadClicked)));
            this.Menu.Add("markasunread", new ToolStripMenuItem(i18n.MarkAsUnread, Assets.Images.Icons.Png._16.unread, new EventHandler(MenuMarkAllAsUnReadClicked)));
        }
Ejemplo n.º 3
0
        // Tries parsing a drag & dropped link to see if it's a podcast and parsable.
        public override bool AddSubscriptionFromUrl(string link)
        {
            if (Subscriptions.Instance.Dictionary.ContainsKey(link))
            {
                MessageBox.Show(string.Format(i18n.PodcastSubscriptionAlreadyExists, Subscriptions.Instance.Dictionary[link].Name), i18n.SubscriptionExists, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return true;
            }

            var podcastSubscription = new PodcastSubscription { Name = "test-podcast", Url = link };

            using (var podcast = new Podcast(podcastSubscription))
            {
                if (!podcast.IsValid()) return false;

                string podcastName = "";
                if (InputBox.Show(i18n.AddNewPodcastTitle, i18n.AddNewPodcastMessage, ref podcastName) != DialogResult.OK) return true;
                podcastSubscription.Name = podcastName;

                if (Subscriptions.Instance.Add(podcastSubscription)) this.MenuRefresh(this, new EventArgs());
            }

            return true;
        }
Ejemplo n.º 4
0
        public void ConsumeSubscription(string entryUrl)
        {
            Match match = this._subscriptionConsumerRegex.Match(entryUrl);
            if (!match.Success) return;

            string name = match.Groups["Name"].Value;
            string url = match.Groups["Url"].Value;

            var subscription = new PodcastSubscription { Name = name, Url = url };
            Subscriptions.Instance.Add(subscription);
        }