public PopulationAnalysisOutputSelectionPresenter( IPopulationAnalysisOutputSelectionView view, IQuantityListPresenter allOutputsPresenter, IPopulationAnalysisOutputFieldsPresenter selectedOutputsPresenter, IPopulationAnalysisStatisticsSelectionPresenter statisticsSelectionPresenter, IEntitiesInContainerRetriever outputsRetriever, IEventPublisher eventPublisher, IDimensionRepository dimensionRepository, IQuantityPathToQuantityDisplayPathMapper quantityDisplayPathMapper) : base(view) { _allOutputsPresenter = allOutputsPresenter; _selectedOutputsPresenter = selectedOutputsPresenter; _statisticsSelectionPresenter = statisticsSelectionPresenter; _outputsRetriever = outputsRetriever; _eventPublisher = eventPublisher; _quantityDisplayPathMapper = quantityDisplayPathMapper; _timeDimension = dimensionRepository.Time; AddSubPresenters(allOutputsPresenter, _selectedOutputsPresenter, _statisticsSelectionPresenter); _view.AddPopulationOutputsView(_allOutputsPresenter.View); _view.AddSelectedOutputsView(_selectedOutputsPresenter.View); _view.AddStatisticsSelectionView(_statisticsSelectionPresenter.View); _allOutputsPresenter.QuantityDoubleClicked += (o, e) => addOutput(e.Quantity); _allOutputsPresenter.Hide(QuantityColumn.Selection); _statisticsSelectionPresenter.SelectionChanged += (o, e) => selectionChanged(); _allOutputsPresenter.ExpandAllGroups = true; }
protected override void Context() { _view = A.Fake <IQuantitySelectionView>(); _selectedQuantityPresenter = A.Fake <IQuantityListPresenter>(); _allQuantityPresenter = A.Fake <IQuantityListPresenter>(); sut = new QuantitySelectionPresenter(_view, _allQuantityPresenter, _selectedQuantityPresenter); _quantities = new List <IQuantity>(); _simulation = A.Fake <IContainer>(); A.CallTo(() => _simulation.GetAllChildren <IQuantity>()).Returns(_quantities); _selectedQuantities = new List <QuantitySelection>(); }
protected override void Context() { _view = A.Fake <IPopulationAnalysisOutputSelectionView>(); _allOutputsPresenter = A.Fake <IQuantityListPresenter>(); _selectedOutputsPresenter = A.Fake <IPopulationAnalysisOutputFieldsPresenter>(); _statisticSelectionPresenter = A.Fake <IPopulationAnalysisStatisticsSelectionPresenter>(); _outputsRetriever = A.Fake <IEntitiesInContainerRetriever>(); _eventPublisher = A.Fake <IEventPublisher>(); _dimensionRepository = A.Fake <IDimensionRepository>(); _timeDimension = A.Fake <IDimension>(); A.CallTo(() => _dimensionRepository.Time).Returns(_timeDimension); sut = new PopulationAnalysisOutputSelectionPresenter(_view, _allOutputsPresenter, _selectedOutputsPresenter, _statisticSelectionPresenter, _outputsRetriever, _eventPublisher, _dimensionRepository); }
public QuantitySelectionPresenter(IQuantitySelectionView view, IQuantityListPresenter allQuantityListPresenter, IQuantityListPresenter selectedQuantityListPresenter) : base(view) { _allQuantityListPresenter = allQuantityListPresenter; _selectedQuantityListPresenter = selectedQuantityListPresenter; _view.SetQuantityListView(_allQuantityListPresenter.View); _view.SetSelectedQuantityListView(_selectedQuantityListPresenter.View); _allQuantityListPresenter.SelectionChanged += updateSelection; _selectedQuantityListPresenter.SelectionChanged += updateSelection; AddSubPresenters(_allQuantityListPresenter, _selectedQuantityListPresenter); ExpandAllGroups = false; //per default, selection always selected selectedQuantityListPresenter.ExpandAllGroups = true; }
public void AttachPresenter(IQuantityListPresenter presenter) { _presenter = presenter; }