using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using MVP;namespace WinFirst{ public partial class Form1 : Form,IFirstView { private FirstPresenter firstPresenter; public Form1() { InitializeComponent(); firstPresenter = new FirstPresenter(this); } #region IView成员 public event EventHandler Save; public event EventHandler Option; public string MVPName { get { return this.txtName.Text; } set { this.txtName.Text = value; } } public string MVPPassword { get { return this.txtPwd.Text; } set { this.txtPwd.Text = value; } } public string MVPTip { get { return this.lblTip.Text; } set { this.lblTip.Text = value; } } #endregion private void btnSure_Click(object sender, EventArgs e) { if (this.Save != null) { this.Save(sender,e); } } private void btnOption_Click(object sender, EventArgs e) { if (this.Option != null) { this.Option(sender,e); } } }}
评论