作為包含應用狀態和狀態操作行為的Model通過如下一個簡單的EmployeeRepository類型來體現
public class EmployeeRepository
{
private static IList<Employee> employees;
static EmployeeRepository()
{
employees = new List<Employee>()
employees
new DateTime(
employees
new DateTime(
employees
new DateTime(
}
public IEnumerable<Employee> GetEmployees(string department =
{
if (string
{
return employees;
}
return employees
}
}
接下來我們來看作為View接口的IEmployeeSearchView的定義
public interface IEmployeeSearchView
{
void BindEmployees(IEnumerable<Employee> employees)
void BindDepartments(IEnumerable<string> departments)
event EventHandler<DepartmentSelectedEventArgs> DepartmentSelected;
}
public class DepartmentSelectedEventArgs : EventArgs
{
public string Department { get; private set; }
public DepartmentSelectedEventArgs(string department)
{
this
}
}
返回目錄
編輯推薦
Java程序性能優化
Visual C++音頻/視頻技術開發與實戰
[
From:http://tw.wingwit.com/Article/program/net/201311/16127.html