public MainWindowController(IView view, Scene scene) { if (view == null) { throw new ArgumentNullException(nameof(view)); } if (scene == null) { throw new ArgumentNullException(nameof(scene)); } _view = view; _scene = scene; _view.SetSize(_scene.Width, _scene.Height); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var sceneWidth = 1300; var sceneHeight = 700; var minRectWidth = 50; var minRectHeight = 50; var scene = new Scene(sceneWidth, sceneHeight, new RandomGraphicObjectBuilder(sceneWidth, sceneHeight, minRectWidth, minRectHeight), new SimpleRectangleOffsetsAdjuster(sceneWidth, sceneHeight)); var mainWnd = new MainWindow(); var mainWndController = new MainWindowController(mainWnd, scene); mainWnd.SetController(mainWndController); try { Application.Run(mainWnd); } catch { // Log something } }