Пример #1
0
 public void RemoveAllChildren()
 {
     foreach (ITreeItem child in children)
     {
         child.Parent = null;
     }
     children.Clear();
     ChildrenCleared?.Invoke(this, EventArgs.Empty);
 }
Пример #2
0
        public virtual void ClearChildren()
        {
            while (Children.Count > 0)
            {
                GraphicObject g = Children[Children.Count - 1];
                g.LayoutChanged -= OnChildLayoutChanges;
                g.ClearBinding();
                g.Parent = null;
                Children.RemoveAt(Children.Count - 1);
            }

            resetChildrenMaxSize();

            this.RegisterForLayouting(LayoutingType.Sizing);
            ChildrenCleared.Raise(this, new EventArgs());
        }
Пример #3
0
        public virtual void ClearChildren()
        {
            childrenRWLock.EnterWriteLock();

            while (Children.Count > 0)
            {
                GraphicObject g = Children [Children.Count - 1];
                g.LayoutChanged -= OnChildLayoutChanges;
                Children.RemoveAt(Children.Count - 1);
                g.Dispose();
            }

            childrenRWLock.ExitWriteLock();

            resetChildrenMaxSize();

            this.RegisterForLayouting(LayoutingType.Sizing);
            ChildrenCleared.Raise(this, new EventArgs());
        }