public void InsertBefore(Bond front) { if (front.Previous != null) { Bond back = front.Previous; this.Next = front; this.Previous = back; back.Next = this; front.Previous = this; } else { this.Previous = null; this.Next = front; front.Previous = this; } }
public void InsertAfter(Bond back) { if (back.Next != null) { Bond front = back.Previous; this.Next = front; this.Previous = back; back.Next = this; front.Previous = this; } else { this.Previous = back; this.Next = null; back.Next = this; } }