Пример #1
0
        //----------------------------------------------------------------------
        // Static methods
        //----------------------------------------------------------------------

        public static void AddToFront(ref DLink pCurrentHead, DLink pNodeToAdd)
        {
            // Set current node as next of new node
            pNodeToAdd.SetNext(pCurrentHead);

            // Set new node as prev to current node
            if (pCurrentHead != null)
            {
                pCurrentHead.SetPrev(pNodeToAdd);
            }

            // Set new node as head of list
            pCurrentHead = pNodeToAdd;
        }