/// <summary> /// Retire un fils /// </summary> /// <param name="child"></param> public void RemoveChild(IHierarchyObject child) { foreach (IHierarchyObject item in childrenListChangeHandler.Items) { if (item.GetPosition() > child.GetPosition()) { item.SetPosition(item.GetPosition() - 1); childrenListChangeHandler.AddUpdated((Attribute)item); } } child.SetPosition(-1); Attribute Child = (Attribute)child; if (Child.valueListChangeHandler.Items.Count > 0) { AttributeValue root = Child.valueListChangeHandler.Items[0].parent; for (int i = root.GetItems().Count - 1; i >= 0; i--) { AttributeValue value = root.childrenListChangeHandler.Items[i]; root.RemoveChild(value); } Child.removeDefaultValue(); } childrenListChangeHandler.AddDeleted(Child); UpdateParents(); }
/// <summary> /// Rajoute un fils /// </summary> /// <param name="child"></param> public void AddChild(IHierarchyObject child) { child.SetPosition(childrenListChangeHandler.Items.Count + 1); child.SetParent(this); childrenListChangeHandler.AddNew((PresentationSlideItem)child); UpdateParents(); OnPropertyChanged("childrenListChangeHandler.Items"); }
/// <summary> /// Rajoute un fils /// </summary> /// <param name="child"></param> public void AddChild(IHierarchyObject child) { child.SetPosition(childrenListChangeHandler.Items.Count); child.SetParent(this); childrenListChangeHandler.AddNew((PeriodInterval)child); UpdateParents(); OnPropertyChanged("childrenListChangeHandler.Items"); }
/// <summary> /// Rajoute un fils /// </summary> /// <param name="child"></param> public void AddChild(IHierarchyObject child) { child.SetPosition(childrenListChangeHandler.Items.Count); child.SetParent(this); childrenListChangeHandler.AddNew((Role)child); bubbleSortDesc(childrenListChangeHandler.Items); UpdateParents(); OnPropertyChanged("childrenListChangeHandler.Items"); }
/// <summary> /// Oublier un fils /// </summary> /// <param name="child"></param> public void ForgetChild(IHierarchyObject child) { foreach (IHierarchyObject item in childrenListChangeHandler.Items) { if (item.GetPosition() > child.GetPosition()) { item.SetPosition(item.GetPosition() - 1); } } child.SetPosition(-1); childrenListChangeHandler.forget((PresentationSlideItem)child); }
/// <summary> /// Retire un fils /// </summary> /// <param name="child"></param> public void RemoveChild(IHierarchyObject child) { foreach (IHierarchyObject item in childrenListChangeHandler.Items) { if (item.GetPosition() > child.GetPosition()) { item.SetPosition(item.GetPosition() - 1); } } child.SetPosition(-1); childrenListChangeHandler.AddDeleted((BGroup)child); }
/// <summary> /// Oublier un fils /// </summary> /// <param name="child"></param> public void ForgetChild(IHierarchyObject child) { foreach (IHierarchyObject item in childrenListChangeHandler.Items) { if (item.GetPosition() > child.GetPosition()) { item.SetPosition(item.GetPosition() - 1); } } child.SetPosition(-1); childrenListChangeHandler.forget((AttributeValue)child); }
/// <summary> /// Retire un fils /// </summary> /// <param name="child"></param> public void RemoveChild(IHierarchyObject child) { foreach (IHierarchyObject item in childrenListChangeHandler.Items) { if (item.GetPosition() > child.GetPosition()) { item.SetPosition(item.GetPosition() - 1); childrenListChangeHandler.AddUpdated((AttributeValue)item); } } child.SetPosition(-1); childrenListChangeHandler.AddDeleted((AttributeValue)child); UpdateParents(); }
public void MoveNode(Kernel.Domain.PeriodName item, bool up) { if (item.parent != null) { int position = item.position + (up ? -1 : 1); IHierarchyObject child = item.parent.GetChildByPosition(position); if (child != null) { child.SetPosition(item.position); item.parent.UpdateChild(child); item.SetPosition(position); item.parent.UpdateChild(item); if (Changed != null) { Changed(); } } } }
/// <summary> /// Déplace un noeud vers le haut ou vers le bas /// </summary> /// <param name="item"></param> /// <param name="sens">Le sens du déplacement. 0 => UP, 1=> DOWN</param> public void MoveNode(IHierarchyObject item, int sens = 0) { if (item.GetParent() != null) { int position = item.GetPosition() + (sens == 0 ? -1 : 1); IHierarchyObject child = item.GetParent().GetChildByPosition(position); if (child != null) { child.SetPosition(item.GetPosition()); item.GetParent().UpdateChild(child); item.SetPosition(position); item.GetParent().UpdateChild(item); if (Change != null) { Change(); } SelectItem(this, item); } } }