public void Delete() { var lockObject = this.Parent == null ? RootLockObject : this.Parent; lock (lockObject) { if (this.Parent != null) { this.Parent.Children.Remove(this); } this.DocumentHierarchyNode = null; this.Children = null; this.Parent = null; } }
public TreeViewEntryItemModel(INode node, TreeViewEntryItemModel parent, bool isSelected) { var lockObject = this.Parent == null ? RootLockObject : this.Parent; lock (lockObject) { this.State = new TreeViewEntryItemModelState(false, isSelected); this.DocumentHierarchyNode = node; this.Parent = parent; this.Children = new TreeViewEntryItemObservableSet(); if (this.Parent != null) { this.Parent.Children.Add(this); } } }