public virtual void FillRss <T>(System.Collections.IEnumerator eData) { while (eData.MoveNext()) { T data = (T)eData.Current; Type type = data.GetType(); bool publicRss = (bool)type.GetProperty("PublicRss").GetValue(data, null); if (!publicRss) { continue; } RssItemModel model = new RssItemModel(); int articleNo = (int)type.GetProperty("ArticleNo").GetValue(data, null); model.Title = type.GetProperty("Title").GetValue(data, null).ToString(); model.Link = Util.Utility.MakeArticleUrl(articleNo); model.Description = type.GetProperty("Content").GetValue(data, null).ToString(); model.Author = BlogManager.GetInstance().BlogBaseModel.BlogModel.Name; model.PubDate = type.GetProperty("InsertDate").GetValue(data, null).ToString(); TagBindModel tagBindModel = (TagBindModel)type.GetProperty("Tag").GetValue(data, null); foreach (TagModel tagModel in tagBindModel) { model.Category.Add(tagModel); } this.Item.Add(model); } }
public void Add(RssItemModel model) { items.Add( model ); }
public void Add(RssItemModel model) { items.Add(model); }