コード例 #1
0
        public MainForm(NodeCollection nodes, TimerSwitch timerSwitch, Size clientSize)
        {
            InitializeComponent();
            this.SetStyle(ControlStyles.DoubleBuffer, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            this.nodes = nodes;
            this.timerSwitch = timerSwitch;
            this.ClientSize = clientSize;
            nodes.PropertyChanged += nodes_PropertyChanged;
            timerSwitch.PropertyChanged += timerSwitch_PropertyChanged;
        }
コード例 #2
0
        public MainForm(NodeCollection nodes, TimerSwitch timerSwitch, Size clientSize)
        {
            InitializeComponent();
            this.SetStyle(ControlStyles.DoubleBuffer, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            this.nodes                   = nodes;
            this.timerSwitch             = timerSwitch;
            this.ClientSize              = clientSize;
            nodes.PropertyChanged       += nodes_PropertyChanged;
            timerSwitch.PropertyChanged += timerSwitch_PropertyChanged;
        }
コード例 #3
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);
        }
コード例 #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);
        }
コード例 #5
0
 public TimerController(TimerSwitch timerSwitch)
 {
     this.timerSwitch = timerSwitch;
 }
コード例 #6
0
 public TimerController(TimerSwitch timerSwitch)
 {
     this.timerSwitch = timerSwitch;
 }