public ExplicitFormulaBuilderDTO MapFrom(ExplicitFormula explicitFormula, IUsingFormula usingFormula)
        {
            var dto = Map <ExplicitFormulaBuilderDTO>(explicitFormula);

            dto.FormulaString = explicitFormula.FormulaString;
            dto.Dimension     = explicitFormula.Dimension;
            dto.ObjectPaths   = _formulaUsablePathDTOMapper.MapFrom(updateObjectPaths(explicitFormula, usingFormula), explicitFormula);
            return(dto);
        }
Ejemplo n.º 2
0
        public TableFormulaWithOffsetDTO MapFrom(TableFormulaWithOffset tableFormulaWithOffset)
        {
            var dto = Map <TableFormulaWithOffsetDTO>(tableFormulaWithOffset);

            var offsetPath = getPathByAlias(tableFormulaWithOffset, tableFormulaWithOffset.OffsetObjectAlias);

            if (offsetPath != null)
            {
                dto.OffsetObjectPath = _mapper.MapFrom(offsetPath, tableFormulaWithOffset);
            }

            var tableObjectPath = getPathByAlias(tableFormulaWithOffset, tableFormulaWithOffset.TableObjectAlias);

            if (tableObjectPath != null)
            {
                dto.TableObjectPath = _mapper.MapFrom(tableObjectPath, tableFormulaWithOffset);
            }

            return(dto);
        }
        public TableFormulaWithXArgumentDTO MapFrom(TableFormulaWithXArgument tableFormulaWithXArgument)
        {
            var dto = Map <TableFormulaWithXArgumentDTO>(tableFormulaWithXArgument);

            var xArgumentObjectPath = getPathByAlias(tableFormulaWithXArgument, tableFormulaWithXArgument.XArgumentAlias);

            if (xArgumentObjectPath != null)
            {
                dto.XArgumentObjectPath = _mapper.MapFrom(xArgumentObjectPath, tableFormulaWithXArgument);
            }

            var tableObjectPath = getPathByAlias(tableFormulaWithXArgument, tableFormulaWithXArgument.TableObjectAlias);

            if (tableObjectPath != null)
            {
                dto.TableObjectPath = _mapper.MapFrom(tableObjectPath, tableFormulaWithXArgument);
            }

            return(dto);
        }
        public FormulaBuilderDTO MapFrom(IFormula formula)
        {
            if (formula == null)
            {
                return(FormulaBuilderDTO.NULL);
            }

            var dto = Map <FormulaBuilderDTO>(formula);

            if (formula.IsConstant())
            {
                dto.FormulaString = ((ConstantFormula)formula).Value.ConvertedTo <string>();
            }

            else if (formula.IsExplicit())
            {
                dto.FormulaString = ((ExplicitFormula)formula).FormulaString;
            }

            dto.FormulaType = _resolver.TypeFor(formula);
            dto.Dimension   = formula.Dimension;
            dto.ObjectPaths = _formulaUsablePathMapper.MapFrom(formula);
            return(dto);
        }
 public void Edit(IFormula formula, IUsingFormula formulaOwner)
 {
     _formulaOwner = formulaOwner;
     _formula      = formula;
     _view.BindTo(_formulaUsablePathDTOMapper.MapFrom(formula, _formulaOwner));
 }