示例#1
0
 public void SetValue(object value)
 {
     if (this.Line == null)
     {
         if (throwEvent && Added != null)
         {
             Added(this);
         }
     }
     if (value is IList)
     {
         var liste = value as IList;
         throwEvent = false;
         for (int i = 0; i < liste.Count; i++)
         {
             TransformationTreeLoopValue item  = new TransformationTreeLoopValue(ValueListChangeHandler.Items.Count + 1, liste[i]);
             AllocationValueItemField    field = this.Add(item);
             if (field != null)
             {
                 this.ValueListChangeHandler.AddNew(field.LoopValue);
             }
         }
         throwEvent = true;
         if (liste.Count > 0 && throwEvent && Added != null)
         {
             Updated(this);
         }
         if (liste.Count > 0)
         {
             onChange();
         }
     }
     else
     {
         TransformationTreeLoopValue item = new TransformationTreeLoopValue(ValueListChangeHandler.Items.Count + 1, value);
         this.Add(item);
     }
 }
示例#2
0
 /// <summary>
 /// Construit une nouvelle instance de LineItemField
 /// </summary>
 /// <param name="index">Index du panel</param>
 /// <param name="item">LineItem à afficher</param>
 public AllocationValueItemField(TransformationTreeLoopValue item)
     : this(item.position)
 {
     this.LoopValue = item;
 }
示例#3
0
        public AllocationValueItemField Add(TransformationTreeLoopValue item)
        {
            AllocationValueItemField field = new AllocationValueItemField(item);

            return(this.Add(field));;
        }