예제 #1
0
        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);
        }
예제 #2
0
    public BackgroundNodeTests()
    {
        initialState             = A.Dummy <IBackgroundState>();
        newState                 = A.Dummy <IBackgroundState>();
        when                     = A.Dummy <ICondition>();
        context                  = A.Dummy <INavigationContext>();
        context.State.Background = initialState;

        sut = new BackgroundNode(newState, when);
    }
예제 #3
0
        private static void CreateStateInstancees(IApplicationController applicationController,
                                                  out IBackgroundState backgroundState, out IGridState gridState, out IScaleState scaleState, out IDataDrawState graphState, out IGraphControlFormState graphControlFormState)
        {
            backgroundState = new BackgroundState();
            applicationController.RegisterInstance <IBackgroundState>(backgroundState);

            gridState = new GridState();
            applicationController.RegisterInstance <IGridState>(gridState);

            scaleState = new ScaleState();
            applicationController.RegisterInstance <IScaleState>(scaleState);

            graphState = new DataDrawState();
            applicationController.RegisterInstance <IDataDrawState>(graphState);

            graphControlFormState = new GraphControlFormState();
            applicationController.RegisterInstance <IGraphControlFormState>(graphControlFormState);
        }
예제 #4
0
        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);
        }
예제 #5
0
 public BackgroundPresenter(IBackgroundView view, IBackgroundState state)
 {
     this.View  = view;
     this.state = state;
 }
예제 #6
0
 public BackgroundNode(IBackgroundState state, ICondition?when)
 => (State, When) = (state, when);
예제 #7
0
 public BackgroundChangeEvent(IBackgroundState state)
 => State = state;