public void SetConcatenationFormula(Guid propertyId, ConcatenationFormulaDescriptor concatenationFormulaDescriptor)
        {
            var dependencies = concatenationFormulaDescriptor.Parts
                .Where(x => x.IsPropRef)
                .Cast<ConcatenationPropRef>()
                .Select(x=>x.Value);

            Apply(new PropertyDependenciesSet(Id, propertyId, dependencies.ToList()));
            Apply(new ConcatenationPropertyFormulaSet(Id, propertyId, concatenationFormulaDescriptor));
        }
        public void SetConcatenationFormula(Guid formId, Guid propertyId, IList<string> values)
        {
            if (values == null) values = new List<string>();
            var regex = new Regex("{{(.+)}}", RegexOptions.Compiled);
            var parts = values
                .Select(x =>
                {
                    var propRef = regex.Match(x);
                    return propRef.Success
                        ? ConcatenationFormulaPart.CreatePropRef(new Guid(propRef.Groups[1].Value))
                        : ConcatenationFormulaPart.CreateConstant(x);
                });

            var formula = new ConcatenationFormulaDescriptor(parts);
            _commandSender.SendCommand(new SetFormulaForConcatenationProperty(formId, propertyId, formula));
        }
 public SetFormulaForConcatenationProperty(Guid formId, Guid propertyId, ConcatenationFormulaDescriptor formula)
 {
     FormId = formId;
     PropertyId = propertyId;
     Formula = formula;
 }