示例#1
0
        protected override void OnStartup(StartupEventArgs args)
        {
            CalculatorEngine    ce = new CalculatorEngine();
            CalculatorViewModel vm = new CalculatorViewModel(ce);
            CalculatorView      cv = new CalculatorView();

            cv.DataContext = vm;
            cv.Show();
        }
示例#2
0
        public Form1()
        {
            InitializeComponent();

            currentValue = "0";
            InvalidateResultTextBox();

            calculatorView = CalculatorView.Standard;
            InvalidateCalculatorView();
        }
示例#3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var view      = new CalculatorView();
            var model     = new CalculatorModel();
            var presenter = new CalculatorPresenter(view, model);

            presenter.StartView();
        }
示例#4
0
 private void ScientificToolStripMenuItem_Click(object sender, EventArgs e)
 {
     calculatorView = CalculatorView.Scientific;
     InvalidateCalculatorView();
 }
示例#5
0
 private void StandardToolStripMenuItem_Click(object sender, EventArgs e)
 {
     calculatorView = CalculatorView.Standard;
     InvalidateCalculatorView();
 }
 public Controller()
 {
     Calculator     = new Calculator();
     CalculatorView = new CalculatorView();
 }