Пример #1
0
        /// <summary>method: completeSetUp
        /// make controller
        /// make model
        /// make views and
        /// show views
        /// </summary>
        private void completeSetUp()
        {
            // make controller
            theController = new CountryController();
            // make model
            theModel = new CountryModel(theController);
            // make views
            myViewForm1         = new GraphicView();
            myViewForm2         = new TextView();
            myViewForm3         = new ReadOnlyView();
            myViewForm1.MyModel = theModel;
            myViewForm2.MyModel = theModel;
            myViewForm3.MyModel = theModel;

            theController.AddView(myViewForm1);
            theController.AddView(myViewForm2);
            theController.AddView(myViewForm3);

            //show views
            myViewForm3.Show();
            myViewForm2.Show();
            myViewForm1.Show();
        }
Пример #2
0
/// this block of code for button clicks is redundant as it is all included
/// in the completeSetUp method which runs when the form loads.

        private void btnMakeController_Click(object sender, System.EventArgs e)
        {
            theController = new CountryController();
        }
Пример #3
0
 public CountryModel(CountryController aController)
 {
     countryList   = new ArrayList();
     theController = aController;
 }