Exemplo n.º 1
0
        }                                                                                                                   //return new ObservableCollection<Measure>(from measure in calculatedMeasureItemListChangeHandler.Items orderby measure.position select measure); }

        /// <summary>
        /// Rajoute un fils
        /// </summary>
        /// <param name="item"></param>
        public void AddItem(CalculatedMeasureItem item, bool sort = true)
        {
            item.SetPosition(calculatedMeasureItemListChangeHandler.Items.Count);
            item.SetParent(this);
            calculatedMeasureItemListChangeHandler.AddNew(item, sort);
            UpdateParents();
            OnPropertyChanged("calculatedMeasureItemListChangeHandler.Items");
        }
Exemplo n.º 2
0
 /// <summary>
 /// Oublier un fils
 /// </summary>
 /// <param name="item"></param>
 public void ForgetItem(CalculatedMeasureItem itemToForget)
 {
     foreach (CalculatedMeasureItem item in calculatedMeasureItemListChangeHandler.Items)
     {
         if (item.GetPosition() > itemToForget.GetPosition())
         {
             item.SetPosition(item.GetPosition() - 1);
         }
     }
     itemToForget.SetPosition(-1);
     calculatedMeasureItemListChangeHandler.forget(itemToForget);
 }
Exemplo n.º 3
0
        /// <summary>
        /// copie exacte
        /// </summary>
        /// <returns></returns>
        public CalculatedMeasureItem GetCopy(CalculatedMeasureItem item)
        {
            if (item == null)
            {
                item = new CalculatedMeasureItem();
            }
            item.amount = this.amount;

            item.measure     = this.measure;
            item.measureType = this.measureType;
            item.sign        = this.sign;
            return(item);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Retire un fils
 /// </summary>
 /// <param name="item"></param>
 public void RemoveItem(CalculatedMeasureItem itemToRemove)
 {
     if (calculatedMeasureItemListChangeHandler.Items.Contains(itemToRemove))
     {
         foreach (CalculatedMeasureItem item in calculatedMeasureItemListChangeHandler.Items)
         {
             if (item.GetPosition() > itemToRemove.GetPosition())
             {
                 item.SetPosition(item.GetPosition() - 1);
             }
             if (!item.Equals(itemToRemove))
             {
                 calculatedMeasureItemListChangeHandler.AddUpdated(item);
             }
         }
         calculatedMeasureItemListChangeHandler.AddDeleted(itemToRemove);
         itemToRemove.SetPosition(-1);
         UpdateParents();
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// Met à jour un fils
 /// </summary>
 /// <param name="item"></param>
 public void UpdateItem(CalculatedMeasureItem updatedItem, bool sort = true)
 {
     calculatedMeasureItemListChangeHandler.AddUpdated(updatedItem, sort);
     UpdateParents();
     OnPropertyChanged("calculatedMeasureItemListChangeHandler.Items");
 }