public override void SetParent(PersistentTreeBase <T> parent) { base.SetParent(parent); foreach (var child in Elements) { child.SetParent(this); } }
/// <summary> Sets the parent of this persistent tree node. Throws if it is already set. Specify null to indicate this is the root. </summary> public virtual void SetParent(PersistentTreeBase <T> parent) { Contract.Requires(this.parent == null); this.parent = parent ?? noParent; }