private static void AddToListBeforeNode(TimeEvent pNewNode, TimeEvent pNextNode) { // Set new node pointers pNewNode.SetNext(pNextNode); pNewNode.SetPrev(pNextNode.GetPrev()); if (pNextNode.GetPrev() != null) { // Set previous node pointer pNextNode.GetPrev().SetNext(pNewNode); } // Set next node pointer pNextNode.SetPrev(pNewNode); }
private static void AddToListAfterNode(TimeEvent pNewNode, TimeEvent pPrevNode) { // Set new node pointers pNewNode.SetNext(pPrevNode.GetNext()); pNewNode.SetPrev(pPrevNode); // Set next node pointer if (pPrevNode.GetNext() != null) { pPrevNode.GetNext().SetPrev(pNewNode); } // Set previous node pointer pPrevNode.SetNext(pNewNode); }