Example #1
0
        static void Main()
        {
            var view = new MainFormView();
            var model = new MainFormModel();
            var controller = new MainFormController(model,view);

            Application.EnableVisualStyles();
            // Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(view);
        }
        public MainFormController(MainFormModel model, MainFormView view)
        {
            //todo check model and view if null
            _model = model;
            _view = view;

            _view.AddButtonListener(AddButtonClick);
            _view.EditButtonListener(EditButtonClick);
            _view.DeleteButtonListener(DeleteButtonClick);
            _view.SearchButtonListener(SearchButtonClick);
            _view.PrintButtonListener(PrintButtonClick);
        }
Example #3
0
 void IMainFormView.ShowResult(MainFormModel model)
 {
     if (this.uxUnparsedTextBox.Text != model.Input)
     {
         this.uxUnparsedTextBox.Text = model.Input;
     }
     if (this.uxAttributeTextBox.Text != model.AttributeDecorator)
     {
         this.uxAttributeTextBox.Text = model.AttributeDecorator;
     }
     if (this.uxINotifyPropertyChangedCheckBox.Checked != model.IsINotifyPropertyChanged)
     {
         this.uxINotifyPropertyChangedCheckBox.Checked = model.IsINotifyPropertyChanged;
     }
     this.uxResultTextbox.Text = model.Result;
 }
Example #4
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     base.Text = string.Concat(new string[] { Application.ProductName, " ", Application.ProductVersion, " by ", Application.CompanyName });
     MainFormModel mainFormModel = new MainFormModel();
 }