我试图了解MVP设计模式。我有应用程序WinForms(查看)+ DLL(IVIEW,IMODEL)
1)演员在哪里更好? DLL或WinForms应用程序?
2)我在哪里调用SaveFile()方法将结果保存到文件中?
public MyPresenter(IMyModel model, IMyView view)
{
...
this.view.SavetoFile += View_SavetoFile;
}
private void View_SavetoFile(object sender, EventArgs e)
{
SaveFile()
}
private void SaveFile()
{
using (var saveFileDialog = new SaveFileDialog())
{
if (DialogResult.OK == saveFileDialog.ShowDialog())
{
using (var xnmlFile = new XMLFile(saveFileDialog.FileName))
{
xmlFile.Save(this.model.Result)
}
}
}
是吗?