Code
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace Model
{
public class ArticleCollection : CollectionBase
{
private int articleCount;
/// <summary>
/// 文章数量
/// </summary>
public int ArticleCount
{
get { return articleCount; }
set { articleCount = value; }
}
public ArticleModel this[int index]
{
set { List[index] = value; }
get { return (ArticleModel)List[index]; }
}
public void Add(ArticleModel article)
{
List.Add(article);
}
public ArticleModel GetArticleModelByArticleID(int articleID)
{
ArticleModel article = new ArticleModel();
foreach (ArticleModel am in List)
{
if (am.ArticleID == articleID)
{
article = am;
}
}
return article;
}
}
}