public CalculatorController(CalculatorVew view, CalculatorModel model)
        {
            _view  = view;
            _model = model;

            _view.CalculateCalled += CalculateBonus;
        }
Exemplo n.º 2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            BonusBands b = new BonusBands()
                           .AddBand(0, 0.01)
                           .AddBand(10000, 0.05)
                           .AddBand(30000, 0.1)
                           .AddBand(100000, 0.2)
                           .AddBand(1000000, 0.4);

            CalculatorVew        view       = new CalculatorVew();
            CalculatorModel      model      = new CalculatorModel(b);
            CalculatorController controller = new CalculatorController(view, model);

            Application.Run(view);
        }