Example #1
0
 public void SetController(MainWindowController wndController)
 {
     if (wndController == null)
     {
         throw new ArgumentNullException(nameof(wndController));
     }
     _wndController = wndController;
 }
Example #2
0
        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
            }
        }