public void SetData(AttributionRuleDTO dto)
 {
     RuleName = dto.RuleName;
     Target = (Name)dto.Target;
     Value = dto.Value;
     Conditions = new ConditionSet(dto.Conditions);
 }
 public object AddElement()
 {
     var dto = new AttributionRuleDTO() { RuleName = "New Attribution Rule", Value = 1, Target = "-" };
     var dialog = new AddOrEditAttributionRuleForm(this, dto);
     dialog.ShowDialog(_parent);
     return dialog.AddedObject;
 }
        public ObjectView<AttributionRuleDTO> AddOrUpdateRule(AttributionRuleDTO dto)
        {
            if (dto.Id == Guid.Empty)
                dto = _parent.CurrentAsset.AddAttributionRule(dto);
            else
                _parent.CurrentAsset.UpdateAttributionRule(dto);

            _parent.SetModified();
            Reload();

            var index = RuleList.Find(PropertyUtil.GetPropertyDescriptor<AttributionRuleDTO>("Id"), dto.Id);
            return RuleList[index];
        }
 public AttributionRule(AttributionRuleDTO dto)
     : this()
 {
     SetData(dto);
 }