コード例 #1
0
ファイル: Feed.cs プロジェクト: shank8/CPTS-323
        public void refresh(int numArticles)
        {
            mArticles = new List<Article>();

            if( mURL == "" )
            {
               mURL = "http://rss.cnn.com/rss/cnn_topstories.rss";
            }

            var reader = XmlReader.Create(mURL);

            var feed = SyndicationFeed.Load(reader);

            //Loop through all items in the SyndicationFeed
            foreach (var i in feed.Items)
            {
                Article new_article = new Article("", "", DateTime.Today, "");
                if (i.Title.Text != null)
                    new_article.mTitle = i.Title.Text;
                if (i.PublishDate != null)
                    new_article.mPubDate = i.PublishDate;
                if (i.Summary != null)
                    new_article.mDescription = i.Summary.Text;
                if (i.Links[0].Uri.ToString() != null)
                    new_article.mLink = i.Links[0].Uri.ToString();

                new_article.Clean();
                mArticles.Add(new_article);

                if (mArticles.Count() >= (numArticles))
                    return;
            }
        }
コード例 #2
0
ファイル: FeedMarker.cs プロジェクト: shank8/CPTS-323
 public FeedMarker(PointLatLng loc, Article art, GMapControl gmap)
 {
     location = loc;
     article = art;
     this.gmap = gmap;
     addPIN(location);
 }
コード例 #3
0
ファイル: MapView.cs プロジェクト: shank8/CPTS-323
 private void addPIN(PointLatLng point, Article art)
 {
     FeedMarker fm = new FeedMarker(point, art, gmap);
     this.fmList.Add(fm);
 }