Ejemplo n.º 1
0
        public virtual ObjectLink <T> Pop()
        {
            if (_next != null)
            {
                _next._prev = _prev;
            }
            else
            {
                _chain._top = _prev;
            }

            if (_prev != null)
            {
                _prev._next = _next;
            }
            else
            {
                _chain._bottom = _next;
            }

            var prev = _prev;

            _prev  = null;
            _next  = null;
            _chain = null;
            return(prev);
        }
Ejemplo n.º 2
0
        public virtual ObjectLink <T> Push(T value)
        {
            var link = new ObjectLink <T>(this, value);

            Push(link);
            return(link);
        }
Ejemplo n.º 3
0
        public ObjectLink <T> Push(T value)
        {
            var link = new ObjectLink <T>(_chain, value);

            Push(link);
            return(link);
        }
Ejemplo n.º 4
0
 protected virtual void Push(ObjectLink <T> link)
 {
     if (_top != null)
     {
         _top.Push(link);
     }
     else
     {
         _top = _bottom = link;
     }
 }
Ejemplo n.º 5
0
        protected internal virtual void Push(ObjectLink <T> link)
        {
            link._prev = this;
            link._next = _next;

            if (_next != null)
            {
                _next._prev = link;
            }
            else
            {
                _chain._top = link;
            }

            _next = link;
        }