public void AddContent(AbstractHierarchy.ObjectClass Content) { if (FirstObject.Value == null) { FirstObject = new Helpers.WeakRef <AbstractHierarchy.ObjectClass>(Content); } else { var LastObject = FirstObject.Value; while (LastObject != null && LastObject.NextObject.Value != null) { LastObject = LastObject.NextObject.Value; } LastObject.NextObject = new Helpers.WeakRef <AbstractHierarchy.ObjectClass>(Content); } }
public void RemoveContent(AbstractHierarchy.ObjectClass Content) { if (Content == FirstObject.Value) { FirstObject = new Helpers.WeakRef <AbstractHierarchy.ObjectClass>(FirstObject.Value.NextObject.Value); } else { var o = FirstObject.Value; AbstractHierarchy.ObjectClass prev = null; while (o != null) { if (o == Content) { prev.NextObject = new Helpers.WeakRef <AbstractHierarchy.ObjectClass>(o.NextObject.Value); break; } prev = o; o = o.NextObject.Value; } } }