コード例 #1
0
        public StackViewLayout(Transform layout, IBackgroundView background)
        {
            _background = background;
            Layout      = layout;

            OnClosed.Where(x => x == _activeView)
            .Subscribe(HideView)
            .AddTo(LifeTime);

            OnBecameHidden.Where(x => x == _activeView)
            .Subscribe(HideView)
            .AddTo(LifeTime);

            OnBecameVisible.Where(x => x != _activeView)
            .Subscribe(ActivateView)
            .AddTo(LifeTime);
        }
コード例 #2
0
        public DefaultViewLayout(Transform layout, IBackgroundView background)
        {
            _background = background;
            Layout      = layout;

            OnClosed.Where(x => x == _activeView).
            Subscribe(HideView).
            AddTo(LifeTime);

            OnHidden.Where(x => x == _activeView).
            Subscribe(HideView).
            AddTo(LifeTime);

            OnShown.Where(x => x != _activeView).
            Subscribe(ActivateView).
            AddTo(LifeTime);
        }
コード例 #3
0
        protected virtual IViewLayout Create()
        {
            IBackgroundView backgroundView = null;

            if (_backgroundFactory != null)
            {
                backgroundView = _backgroundFactory.Create();
                backgroundView.Hide();
            }

            if (_layoutBehaviourFactory == null)
            {
                throw new NullReferenceException(nameof(_layoutBehaviourFactory));
            }

            return(_layoutBehaviourFactory.Create(_layoutCanvas.transform, backgroundView));
        }
コード例 #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 override IViewLayout Create(Transform canvasPoint, IBackgroundView backgroundView)
 {
     return(new DefaultViewLayout(canvasPoint, backgroundView));
 }
コード例 #6
0
 public abstract IViewLayout Create(Transform canvasPoint, IBackgroundView backgroundView);
コード例 #7
0
 public BackgroundPresenter(IBackgroundView view, IBackgroundState state)
 {
     this.View  = view;
     this.state = state;
 }