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; }
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); }
public TimerController(TimerSwitch timerSwitch) { this.timerSwitch = timerSwitch; }