static void Main(String[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (args.Length == 0 || (type = args[0].ToLower()[1]) == 'c') { Application.Run(new frmConfig()); } else { Painter painter = new Painter(); controller controller = new controller(painter); Timer timer = new Timer(); timer.Interval = 100; timer.Tick += timer_tick; timer.Start(); switch (type) { case 's': Form f = new frmScreen(painter.getPaper()); controller.init(); Application.Run(f); break; case 'p': new otherWindow(int.Parse(args[1]), painter.getPaper()); Application.Run(); break; } } }
public controller(Painter p) { painter = p; main = this; }