public ScalingSelectionPresenter(IScalingSelectionView view, IScalingState state, IRefreshControlView rootControlView, IScaleService scaleService, Color movingPenColor, Color zoomInPenColor, Color zoomOutPenColor) { if (view == null || state == null) { throw new InvalidArgumentException("parameter \"view\" or \"state\" is null"); } this.view = view; this.state = state; this.rootControlView = rootControlView; this.scaleService = scaleService; this.state.MovingPenColor = movingPenColor; this.state.ZoomInPenColor = zoomInPenColor; this.state.ZoomOutPenColor = zoomOutPenColor; }
private static void CreatePresenterInstances(IApplicationController applicationController, IGraphControlFormView formView, IGraphControlView controlView, IScalingSelectionView scalingView, IGraphControlFormState graphControlFormState, IScalingState scalingState, IDataService dataService, IScaleService scaleService, IBufferedDrawingService bufferedDrawingService, IBackgroundPresenter backgroundPresenter, IGridPresenter gridPresenter, IDataPresenter dataPresenter) { var scalingPresenter = new ScalingSelectionPresenter(scalingView, scalingState, controlView, scaleService); applicationController.RegisterInstance <IScalingSelectionPresenter>(scalingPresenter); var graphControlPresenter = new GraphControlPresenter(applicationController, controlView, dataService, scaleService, bufferedDrawingService, backgroundPresenter, gridPresenter, dataPresenter, scalingPresenter ); applicationController.RegisterInstance <IGraphControlPresenter>(graphControlPresenter); var graphControlFormPresenter = new GraphControlFormPresenter( applicationController, formView, graphControlFormState, graphControlPresenter ); applicationController.RegisterInstance <GraphControlFormPresenter>(graphControlFormPresenter); }
private static void CreateViewInstances(IApplicationController applicationController, IGraphControlView controlView, IDataService dataService, IScaleService scaleService, IBackgroundView userBackgroundView, IGridView userGridView, IDataView userDataView, IScalingSelectionView userScalingSelectionView, IBackgroundState userBackgroundState, IGridState userGridState, IDataDrawState userDataDrawState, out IBackgroundPresenter backgroundPresenter, out IGridPresenter gridPresenter, out IDataPresenter dataPresenter, out IScalingSelectionView scalingView) { var backgroundView = userBackgroundView ?? new BackgroundView(); backgroundPresenter = new BackgroundPresenter(backgroundView, userBackgroundState); applicationController.RegisterInstance <IBackgroundPresenter>(backgroundPresenter); var gridView = userGridView ?? new GridView(scaleService); gridPresenter = new GridPresenter(gridView, userGridState); applicationController.RegisterInstance <IGridPresenter>(gridPresenter); var dataView = userDataView ?? new DataView(scaleService, dataService); dataPresenter = new DataPresenter(dataView, userDataDrawState, dataService); applicationController.RegisterInstance <IDataPresenter>(dataPresenter); scalingView = userScalingSelectionView ?? new ScalingView(); // Register IGraphControlView here applicationController.RegisterInstance <IGraphControlView>(controlView); }
public ScalingSelectionPresenter(IScalingSelectionView view, IScalingState state, IRefreshControlView rootControlView, IScaleService scaleService) : this(view, state, rootControlView, scaleService, Color.FromArgb(200, Color.DarkViolet), Color.FromArgb(223, 63, 63, 191), Color.FromArgb(223, 63, 191, 63)) { }