public void SetControllers(NodeController nodeController, TimerController timerController)
 {
     this.button1.Click += timerController.ButtonClick;
     this.timer1.Tick += nodeController.TimerTick;
     this.MouseDown += nodeController.MouseDown;
     this.MouseMove += nodeController.MouseMove;
     this.MouseUp += nodeController.MouseUp;
 }
 public void SetControllers(NodeController nodeController, TimerController timerController)
 {
     this.button1.Click += timerController.ButtonClick;
     this.timer1.Tick   += nodeController.TimerTick;
     this.MouseDown     += nodeController.MouseDown;
     this.MouseMove     += nodeController.MouseMove;
     this.MouseUp       += nodeController.MouseUp;
 }
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // モデルを生成
            NodeCollection nodes = CreateGraph();
            Circularize(nodes, 200.0d);
            TimerSwitch timerSwitch = new TimerSwitch();
            Size clientSize = new Size(600, 600);

            // コントローラを生成
            NodeController nodeController = new NodeController(nodes, clientSize);
            TimerController timerController = new TimerController(timerSwitch);

            // ビューを生成
            MainForm form = new MainForm(nodes, timerSwitch, clientSize);
            form.SetControllers(nodeController, timerController);

            Application.Run(form);
        }
Exemple #4
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // モデルを生成
            NodeCollection nodes = CreateGraph();

            Circularize(nodes, 200.0d);
            TimerSwitch timerSwitch = new TimerSwitch();
            Size        clientSize  = new Size(600, 600);

            // コントローラを生成
            NodeController  nodeController  = new NodeController(nodes, clientSize);
            TimerController timerController = new TimerController(timerSwitch);

            // ビューを生成
            MainForm form = new MainForm(nodes, timerSwitch, clientSize);

            form.SetControllers(nodeController, timerController);

            Application.Run(form);
        }