|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MVPTester
{
class Controller
{
IViewBase _view = null;
ConcreteModel _model = new ConcreteModel();
public Controller(IViewBase view)
{
_view = view;
_model.ModelChanged += new EventHandler(_model_ModelChanged);
}
void _model_ModelChanged(object sender, EventArgs e)
{
if (_view == null)
return;
_view.ChangedState(sender, e);
}
public void Save()
{
if (!_model.IsEntryExisting(_view.UserName))
{
_model.Save(_view.UserName, _view.Email);
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
My aim is to write articles in plain English without any convoluted or periphrastic statements.