Example #1
0
 public MainForm()
 {
     //
     model = new CModel();
     //
     view = new ViewControl(model);
     //
     // Adding View to our controls list:
     this.Controls.Add(view);
     //
     InitializeComponent();
 }
Example #2
0
        // Constructor:
        public ViewControl(CModel model)
        {
            // Setting Model field:
            this.model = model;

            // Setting timer to Invalidate view:
            drawTimer.Interval = 5;
            drawTimer.Tick    += (object sender, EventArgs e) => this.Invalidate();
            drawTimer.Start();

            // Initialising:
            InitializeComponent();
        }