public virtual object Clone() { ClassImplementingIEventedList folderCopy = new ClassImplementingIEventedList(); folderCopy.Name = Name; foreach (var child in Children) { folderCopy.children.Add((ClassImplementingIEventedList)child.Clone()); } return(folderCopy); }
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; } } }
public TreeClient() { Root = new ClassImplementingIEventedList(); }
public virtual bool Remove(object o) { ClassImplementingIEventedList child = (ClassImplementingIEventedList)o; return(Children.Remove(child)); }