public void UpdateHistory() { //We display the history in the reversed chronological order var reversedHistory = HistoryManager.History.Reverse(); var allhistoryItemsDTO = reversedHistory.MapAllUsing(_mapper).Where(dto => !dto.IsAnImplementationOf <NullHistoryItemDTO>()); _historyItemDtoList = _historyItemDTOListMapper.MapFrom(allhistoryItemsDTO); View.BindTo(_historyItemDtoList); }
public HistoryBrowserPresenter(IHistoryBrowserView view, ILabelTask labelTask, ICommentTask commentTask, IHistoryToHistoryDTOMapper mapper, IHistoryItemDTOEnumerableToHistoryItemDTOList historyItemDTOListMapper) { View = view; _labelTask = labelTask; _commentTask = commentTask; _mapper = mapper; _historyItemDTOListMapper = historyItemDTOListMapper; EnableFiltering = true; EnableAutoFilterRow = true; EnableHistoryPruning = true; _historyItemDtoList = historyItemDTOListMapper.MapFrom(Enumerable.Empty <IHistoryItemDTO>()); }
protected override void Context() { _view = A.Fake <IHistoryBrowserView>(); _historyList = new List <IHistoryItem>(); _historyManager = A.Fake <IHistoryManager>(); _historyBrowserProperties = A.Fake <IHistoryBrowserProperties>(); _labelTask = A.Fake <ILabelTask>(); _mapper = A.Fake <IHistoryToHistoryDTOMapper>(); _commentTask = A.Fake <ICommentTask>(); _historyItemDTOListMapper = A.Fake <IHistoryItemDTOEnumerableToHistoryItemDTOList>(); _historyItemDTOList = A.Fake <IHistoryItemDTOList>(); A.CallTo(_historyItemDTOListMapper).WithReturnType <IHistoryItemDTOList>().Returns(_historyItemDTOList); _historyBrowserConfiguration = new HistoryBrowserConfiguration(); A.CallTo(() => _historyManager.History).Returns(_historyList); sut = new HistoryBrowserPresenter(_view, _labelTask, _commentTask, _mapper, _historyItemDTOListMapper); sut.Initialize(); sut.HistoryManager = _historyManager; }
public void BindTo(IHistoryItemDTOList historyItems) { historyTreeList.DataSource = historyItems; RefreshView(); }