Esempio n. 1
0
        public virtual object Clone()
        {
            ClassImplementingIEventedList folderCopy = new ClassImplementingIEventedList();

            folderCopy.Name = Name;

            foreach (var child in Children)
            {
                folderCopy.children.Add((ClassImplementingIEventedList)child.Clone());
            }
            return(folderCopy);
        }
Esempio n. 2
0
        private void ChildCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            // update owner of folder in case the folder belongs to the list of folders contained
            // by this folder.
            if (sender == children)
            {
                ClassImplementingIEventedList folder = (ClassImplementingIEventedList)e.Item;

                switch (e.Action)
                {
                case NotifyCollectionChangedAction.Replace:
                case NotifyCollectionChangedAction.Add:
                    folder.Parent = this;
                    break;

                case NotifyCollectionChangedAction.Remove:
                    folder.Parent = null;
                    break;
                }
            }
        }
Esempio n. 3
0
 public TreeClient()
 {
     Root = new ClassImplementingIEventedList();
 }
Esempio n. 4
0
        public virtual bool Remove(object o)
        {
            ClassImplementingIEventedList child = (ClassImplementingIEventedList)o;

            return(Children.Remove(child));
        }