コード例 #1
0
        void feed_FeedUpdated(object sender, FeedUpdatedEventArgs e)

        {
            if (e != null && e.NewItems != null)

            {
                foreach (FeedItem item in e.NewItems)

                {
                    //this.notifyIcon.ShowBalloonTip(1000, item.SourceFeed.Title.Text, item.Title.Text, ToolTipIcon.Info);



                    Notification n = new Notification(this.app.Name, this.ntNewFeedItem.Name, String.Empty, item.SourceFeed.Title, item.Title);



                    CallbackContext c = null;

                    if (!String.IsNullOrEmpty(item.Link))

                    {
                        c = new CallbackContext(item.Link);
                    }



                    this.growl.Notify(n, c);
                }
            }
        }
コード例 #2
0
ファイル: Feed.cs プロジェクト: sshyran/growl-for-windows
        /// <summary>
        /// Internal method used to raise the feed event
        /// </summary>
        protected void OnFeedRetrieved(FeedInfo feed)
        {
            this.actualName = feed.ActualTitle;
            DateTimeOffset mostRecentItem = this.feedLastUpdated;

            if (mostRecentItem == DateTimeOffset.MaxValue)
            {
                mostRecentItem = DateTimeOffset.MinValue;
            }

            System.Diagnostics.Debug.WriteLine(String.Format("Feed Retrieved: {0} - Most Recent Item: {1}", this.Name, mostRecentItem));

            if (FeedRetrieved != null)
            {
                FeedRetrievedEventArgs e = new FeedRetrievedEventArgs(feed);
                FeedRetrieved(this, e);
            }

            if (FeedUpdated != null)
            {
                List <FeedItem> newitems = new List <FeedItem>();
                foreach (FeedItem item in feed.Items)
                {
                    DateTimeOffset itemDate = item.PubDate;
                    //if (itemDate == DateTimeOffset.MinValue) itemDate = item.PublishDate;

                    System.Diagnostics.Debug.WriteLine(String.Format("Item Published at: {0} - (last update at: {1})", itemDate, this.feedLastUpdated));

                    if (itemDate > mostRecentItem)
                    {
                        mostRecentItem = itemDate;
                    }

                    if (itemDate > this.feedLastUpdated)
                    {
                        newitems.Add(item);
                        item.SourceFeed = feed;
                    }
                }

                FeedUpdatedEventArgs args = new FeedUpdatedEventArgs(newitems);
                FeedUpdated(this, args);
            }
            this.feedLastUpdated = mostRecentItem;  // feed.LastUpdatedTime is not always set =(
        }
コード例 #3
0
ファイル: Feed.cs プロジェクト: iwaim/growl-for-windows
        /// <summary>
        /// Internal method used to raise the feed event
        /// </summary>
        protected void OnFeedRetrieved(FeedInfo feed)
        {
            this.actualName = feed.ActualTitle;
            DateTimeOffset mostRecentItem = this.feedLastUpdated;
            if (mostRecentItem == DateTimeOffset.MaxValue) mostRecentItem = DateTimeOffset.MinValue;

            System.Diagnostics.Debug.WriteLine(String.Format("Feed Retrieved: {0} - Most Recent Item: {1}", this.Name, mostRecentItem));

            if (FeedRetrieved != null)
            {
                FeedRetrievedEventArgs e = new FeedRetrievedEventArgs(feed);
                FeedRetrieved(this, e);
            }

            if (FeedUpdated != null)
            {
                List<FeedItem> newitems = new List<FeedItem>();
                foreach (FeedItem item in feed.Items)
                {
                    DateTimeOffset itemDate = item.PubDate;
                    //if (itemDate == DateTimeOffset.MinValue) itemDate = item.PublishDate;

                    System.Diagnostics.Debug.WriteLine(String.Format("Item Published at: {0} - (last update at: {1})", itemDate, this.feedLastUpdated));

                    if (itemDate > mostRecentItem)
                        mostRecentItem = itemDate;

                    if (itemDate > this.feedLastUpdated)
                    {
                        newitems.Add(item);
                        item.SourceFeed = feed;
                    }
                }

                FeedUpdatedEventArgs args = new FeedUpdatedEventArgs(newitems);
                FeedUpdated(this, args);
            }
            this.feedLastUpdated = mostRecentItem;  // feed.LastUpdatedTime is not always set =(
        }
コード例 #4
0
        void feed_FeedUpdated(object sender, FeedUpdatedEventArgs e)
        {
            if (e != null && e.NewItems != null)
            {
                foreach (FeedItem item in e.NewItems)
                {
                    //this.notifyIcon.ShowBalloonTip(1000, item.SourceFeed.Title.Text, item.Title.Text, ToolTipIcon.Info);

                    Notification n = new Notification(this.app.Name, this.ntNewFeedItem.Name, String.Empty, item.SourceFeed.Title, item.Title);

                    CallbackContext c = null;
                    if (!String.IsNullOrEmpty(item.Link))
                    {
                        c = new CallbackContext(item.Link);
                    }

                    this.growl.Notify(n, c);
                }
            }
        }