private static void CreateStateInstances(IApplicationController applicationController, IItemFormatter itemFormatter, IMargin labelMargin, out IBackgroundState backgroundState, out IGridState gridState, out IScaleState scaleState, out IDataDrawState graphState, out IScalingState scalingState, out IGraphControlFormState graphControlFormState) { backgroundState = new BackgroundState(); applicationController.RegisterInstance <IBackgroundState>(backgroundState); gridState = new GridState(); gridState.LabelPadding = labelMargin; gridState.ItemFormatter = itemFormatter; applicationController.RegisterInstance <IGridState>(gridState); scaleState = new ScaleState(); applicationController.RegisterInstance <IScaleState>(scaleState); graphState = new DataDrawState(); applicationController.RegisterInstance <IDataDrawState>(graphState); scalingState = new ScalingState(); applicationController.RegisterInstance <IScalingState>(scalingState); graphControlFormState = new GraphControlFormState(); applicationController.RegisterInstance <IGraphControlFormState>(graphControlFormState); }
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); }
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)) { }