protected FractalViewPresenterBase( IFractal fractal, IControlPanel controlPanel, IFractalView fractalView, IFractalRenderer renderer) { if (fractal == null) { throw new ArgumentNullException("fractal"); } if (controlPanel == null) { throw new ArgumentNullException("controlPanel"); } if (fractalView == null) { throw new ArgumentNullException("fractalView"); } if (renderer == null) { throw new ArgumentNullException("renderer"); } _fractal = fractal; _controlPanel = controlPanel; _fractalView = fractalView; _renderer = renderer; _fractal.PointsChanged += new EventHandler(_fractal_PointsChanged); _controlPanel.Changed += new EventHandler(_controlPanel_Changed); _fractalView.PaintView += new System.Windows.Forms.PaintEventHandler(_fractalView_Paint); _fractalView.Resize += new EventHandler(_fractalView_Resize); _fractalView.ZoomIn += new ZoomEventHandler(_fractalView_ZoomIn); _fractalView.Translating += new TranslatingEventHandler(_fractalView_Translating); _fractalView.SetNumOfCalculatedPoints(_fractal.Points.Count); if (_fractal.ExactDimension.HasValue) { _fractalView.SetSimilarityDimension(_fractal.ExactDimension.Value.ToString()); } }
private void _fractal_PointsChanged(object sender, EventArgs e) { _fractalView.SetNumOfCalculatedPoints(_fractal.Points.Count); _fractalView.RefreshScreen(); }