public void SelectionChanged(FieldSelectionDTO dto)
        {
            var targetArea = dto.Selected ? PivotArea.DataArea : PivotArea.FilterArea;

            _populationAnalysis.SetPosition(dto.PopulationAnalysisField, targetArea, indexOf(dto));
            SelectedItemChanged();
            _eventPublisher.PublishEvent(new PopulationAnalysisDataSelectionChangedEvent(_populationAnalysis));
        }
        public void MoveDown(FieldSelectionDTO dto)
        {
            int currentIndex = indexOf(dto);

            if (currentIndex == _allFieldsSelection.Count - 1)
            {
                return;
            }
            swapItems(currentIndex, ++currentIndex);
        }
        public void MoveUp(FieldSelectionDTO dto)
        {
            int currentIndex = indexOf(dto);

            if (currentIndex == 0)
            {
                return;
            }
            swapItems(currentIndex, --currentIndex);
        }
 private void updateIndex(FieldSelectionDTO dto, int index)
 {
     _populationAnalysis.SetPosition(dto.PopulationAnalysisField, _populationAnalysis.GetArea(dto.PopulationAnalysisField), index);
 }
 private int indexOf(FieldSelectionDTO dto)
 {
     return(_allFieldsSelection.IndexOf(dto));
 }