Exemplo n.º 1
0
 protected void SetDestinationAttributeValue(Attrib attribute, IEnumerable <object> values)
 {
     if (attribute.IsMultivalued)
     {
         if (values.Count() == 0)
         {
             attribute.Delete();
         }
         else
         {
             this.SetAttributeValues(attribute, values);
         }
     }
     else
     {
         if (values.Count() > 1)
         {
             throw new TooManyValuesException(attribute.Name);
         }
         else if (values.Count() == 0)
         {
             attribute.Delete();
         }
         else
         {
             this.SetAttributeValue(attribute, values.First());
         }
     }
 }
Exemplo n.º 2
0
 private void SetDestinationAttributeValue(FlowRuleParameters parameters, IList <object> values, Attrib attribute)
 {
     if (attribute.IsMultivalued)
     {
         if (values.Count == 0)
         {
             attribute.Delete();
         }
         else
         {
             this.SetAttributeValues(values, attribute);
         }
     }
     else
     {
         if (values.Count > 1)
         {
             throw new TooManyValuesException(parameters.TargetAttributeName);
         }
         else if (values.Count == 0)
         {
             attribute.Delete();
         }
         else
         {
             this.SetAttributeValue(values.First(), attribute);
         }
     }
 }
Exemplo n.º 3
0
        private void SetDestinationAttributeValueForImport(FlowRuleParameters parameters, MVEntry mventry, IList <object> values, bool clearTarget)
        {
            Attrib attribute = mventry[parameters.TargetAttributeName];

            if (clearTarget)
            {
                attribute.Delete();
            }

            this.SetDestinationAttributeValue(parameters, values, attribute);
        }
Exemplo n.º 4
0
        private void SetDestinationAttributeValueForImport(MVEntry mventry, IEnumerable <object> values, bool clearTarget)
        {
            Attrib attribute = mventry[this.TargetAttribute];

            if (clearTarget)
            {
                attribute.Delete();
            }

            this.SetDestinationAttributeValue(attribute, values);
        }