public void Edit(IGroupingDefinition groupingDefinition)
        {
            _groupingDefinition = groupingDefinition.DowncastTo <ValueMappingGroupingDefinition>();
            uint sequence = 1;

            foreach (var value in _groupingDefinition.Mapping.Keys)
            {
                var dto = _mapping.FirstOrDefault(x => string.Equals(x.Value, value));
                if (dto == null)
                {
                    continue;
                }
                dto.UpdateFrom(_groupingDefinition.Mapping[value]);
                dto.Sequence = sequence++;
            }
            bindToView();
        }
        public void Edit(IGroupingDefinition groupingDefinition)
        {
            _groupingDefinition = groupingDefinition.DowncastTo <NumberOfBinsGroupingDefinition>();
            _binSizeGroupingDTO.NumberOfBins  = _groupingDefinition.NumberOfBins;
            _binSizeGroupingDTO.StartColor    = _groupingDefinition.StartColor;
            _binSizeGroupingDTO.EndColor      = _groupingDefinition.EndColor;
            _binSizeGroupingDTO.NamingPattern = _groupingDefinition.NamingPattern;
            _binSizeGroupingDTO.Strategy      = _groupingDefinition.Strategy;

            foreach (var groupingItem in _groupingDefinition.Items)
            {
                var label = new GroupingItemDTO();
                label.UpdateFrom(groupingItem);
                _binSizeGroupingDTO.Labels.Add(label);
            }
            _binSizeGroupingDTO.Symbol = _binSizeGroupingDTO.Labels.First().Symbol;
            bindToView();
        }
Пример #3
0
        public void Edit(IGroupingDefinition groupingDefinition)
        {
            _groupingDefinition = groupingDefinition.DowncastTo <FixedLimitsGroupingDefinition>();
            _fixedLimitDTOs.Clear();
            for (int i = 0; i < _groupingDefinition.Limits.Count; i++)
            {
                var dto = newDTO(maximumInDisplayUnit: _numericField.ValueInDisplayUnit(_groupingDefinition.Limits[i]));
                if (i > 0)
                {
                    dto.Minimum = _fixedLimitDTOs[i - 1].Maximum;
                }

                _fixedLimitDTOs.Add(dto);
            }

            updateFirstAndAddLastEntry(_groupingDefinition.Limits.Last());
            _fixedLimitDTOs.Each((dto, i) => dto.UpdateFrom(_groupingDefinition.Items[i]));

            bindToView();
        }