コード例 #1
0
        public void RemoveAt(int index)
        {
            DataGridViewIntLinkedListElement element     = null;
            DataGridViewIntLinkedListElement headElement = this.headElement;

            while (index > 0)
            {
                element     = headElement;
                headElement = headElement.Next;
                index--;
            }
            DataGridViewIntLinkedListElement next = headElement.Next;

            if (element == null)
            {
                this.headElement = next;
            }
            else
            {
                element.Next = next;
            }
            this.count--;
            this.lastAccessedElement = null;
            this.lastAccessedIndex   = -1;
        }
コード例 #2
0
 public int this[int index]
 {
     get
     {
         if ((this.lastAccessedIndex != -1) && (index >= this.lastAccessedIndex))
         {
             while (this.lastAccessedIndex < index)
             {
                 this.lastAccessedElement = this.lastAccessedElement.Next;
                 this.lastAccessedIndex++;
             }
             return(this.lastAccessedElement.Int);
         }
         DataGridViewIntLinkedListElement headElement = this.headElement;
         for (int i = index; i > 0; i--)
         {
             headElement = headElement.Next;
         }
         this.lastAccessedElement = headElement;
         this.lastAccessedIndex   = index;
         return(headElement.Int);
     }
     set
     {
         if (index != this.lastAccessedIndex)
         {
             int num1 = this[index];
         }
         this.lastAccessedElement.Int = value;
     }
 }
コード例 #3
0
        public void RemoveAt(int index)
        {
            DataGridViewIntLinkedListElement tmp1 = null, tmp2 = _headElement;

            while (index > 0)
            {
                tmp1 = tmp2;
                tmp2 = tmp2.Next;
                index--;
            }

            DataGridViewIntLinkedListElement tmp3 = tmp2.Next;

            if (tmp1 is null)
            {
                _headElement = tmp3;
            }
            else
            {
                tmp1.Next = tmp3;
            }

            Count--;
            _lastAccessedElement = null;
            _lastAccessedIndex   = -1;
        }
コード例 #4
0
 public void Clear()
 {
     _lastAccessedElement = null;
     _lastAccessedIndex   = -1;
     _headElement         = null;
     Count = 0;
 }
コード例 #5
0
 public void Clear()
 {
     lastAccessedElement = null;
     lastAccessedIndex   = -1;
     headElement         = null;
     count = 0;
 }
コード例 #6
0
 public void Clear()
 {
     this.lastAccessedElement = null;
     this.lastAccessedIndex   = -1;
     this.headElement         = null;
     this.count = 0;
 }
 public void Clear()
 {
     this.lastAccessedElement = null;
     this.lastAccessedIndex = -1;
     this.headElement = null;
     this.count = 0;
 }
コード例 #8
0
        public bool Remove(int integer)
        {
            DataGridViewIntLinkedListElement tmp1 = null, tmp2 = headElement;

            while (tmp2 != null)
            {
                if (tmp2.Int == integer)
                {
                    break;
                }
                tmp1 = tmp2;
                tmp2 = tmp2.Next;
            }
            if (tmp2.Int == integer)
            {
                DataGridViewIntLinkedListElement tmp3 = tmp2.Next;
                if (tmp1 == null)
                {
                    headElement = tmp3;
                }
                else
                {
                    tmp1.Next = tmp3;
                }
                count--;
                lastAccessedElement = null;
                lastAccessedIndex   = -1;
                return(true);
            }
            return(false);
        }
コード例 #9
0
        public bool Remove(int integer)
        {
            DataGridViewIntLinkedListElement element     = null;
            DataGridViewIntLinkedListElement headElement = this.headElement;

            while (headElement != null)
            {
                if (headElement.Int == integer)
                {
                    break;
                }
                element     = headElement;
                headElement = headElement.Next;
            }
            if (headElement.Int != integer)
            {
                return(false);
            }
            DataGridViewIntLinkedListElement next = headElement.Next;

            if (element == null)
            {
                this.headElement = next;
            }
            else
            {
                element.Next = next;
            }
            this.count--;
            this.lastAccessedElement = null;
            this.lastAccessedIndex   = -1;
            return(true);
        }
 public void Add(int integer)
 {
     DataGridViewIntLinkedListElement element = new DataGridViewIntLinkedListElement(integer);
     if (this.headElement != null)
     {
         element.Next = this.headElement;
     }
     this.headElement = element;
     this.count++;
     this.lastAccessedElement = null;
     this.lastAccessedIndex = -1;
 }
コード例 #11
0
        public void Add(int integer)
        {
            DataGridViewIntLinkedListElement element = new DataGridViewIntLinkedListElement(integer);

            if (this.headElement != null)
            {
                element.Next = this.headElement;
            }
            this.headElement = element;
            this.count++;
            this.lastAccessedElement = null;
            this.lastAccessedIndex   = -1;
        }
コード例 #12
0
 bool IEnumerator.MoveNext()
 {
     if (this.reset)
     {
         this.current = this.headElement;
         this.reset   = false;
     }
     else
     {
         this.current = this.current.Next;
     }
     return(this.current != null);
 }
コード例 #13
0
        public void Add(int integer)
        {
            DataGridViewIntLinkedListElement newHead = new DataGridViewIntLinkedListElement(integer);

            if (headElement != null)
            {
                newHead.Next = headElement;
            }
            headElement = newHead;
            count++;
            lastAccessedElement = null;
            lastAccessedIndex   = -1;
        }
コード例 #14
0
        public void Add(int integer)
        {
            DataGridViewIntLinkedListElement newHead = new DataGridViewIntLinkedListElement(integer);

            if (_headElement is not null)
            {
                newHead.Next = _headElement;
            }
            _headElement = newHead;
            Count++;
            _lastAccessedElement = null;
            _lastAccessedIndex   = -1;
        }
 bool IEnumerator.MoveNext()
 {
     if (this.reset)
     {
         this.current = this.headElement;
         this.reset = false;
     }
     else
     {
         this.current = this.current.Next;
     }
     return (this.current != null);
 }
コード例 #16
0
 bool IEnumerator.MoveNext()
 {
     if (_reset)
     {
         Debug.Assert(_current is null);
         _current = _headElement;
         _reset   = false;
     }
     else
     {
         Debug.Assert(_current != null); // Since this is for internal use only.
         _current = _current.Next;
     }
     return(_current != null);
 }
コード例 #17
0
 bool IEnumerator.MoveNext()
 {
     if (reset)
     {
         Debug.Assert(current == null);
         current = headElement;
         reset   = false;
     }
     else
     {
         Debug.Assert(current != null); // Since this is for internal use only.
         current = current.Next;
     }
     return(current != null);
 }
 public bool Contains(int integer)
 {
     int num = 0;
     DataGridViewIntLinkedListElement headElement = this.headElement;
     while (headElement != null)
     {
         if (headElement.Int == integer)
         {
             this.lastAccessedElement = headElement;
             this.lastAccessedIndex = num;
             return true;
         }
         headElement = headElement.Next;
         num++;
     }
     return false;
 }
コード例 #19
0
        public bool Contains(int integer)
        {
            int num = 0;
            DataGridViewIntLinkedListElement headElement = this.headElement;

            while (headElement != null)
            {
                if (headElement.Int == integer)
                {
                    this.lastAccessedElement = headElement;
                    this.lastAccessedIndex   = num;
                    return(true);
                }
                headElement = headElement.Next;
                num++;
            }
            return(false);
        }
コード例 #20
0
        public bool Contains(int integer)
        {
            int index = 0;
            DataGridViewIntLinkedListElement tmp = headElement;

            while (tmp != null)
            {
                if (tmp.Int == integer)
                {
                    lastAccessedElement = tmp;
                    lastAccessedIndex   = index;
                    return(true);
                }
                tmp = tmp.Next;
                index++;
            }
            return(false);
        }
コード例 #21
0
        public int this[int index]
        {
            get
            {
                Debug.Assert(index >= 0);
                Debug.Assert(index < Count);
                if (_lastAccessedIndex == -1 || index < _lastAccessedIndex)
                {
                    DataGridViewIntLinkedListElement tmp = _headElement;
                    int tmpIndex = index;
                    while (tmpIndex > 0)
                    {
                        tmp = tmp.Next;
                        tmpIndex--;
                    }

                    _lastAccessedElement = tmp;
                    _lastAccessedIndex   = index;
                    return(tmp.Int);
                }
                else
                {
                    while (_lastAccessedIndex < index)
                    {
                        _lastAccessedElement = _lastAccessedElement.Next;
                        _lastAccessedIndex++;
                    }

                    return(_lastAccessedElement.Int);
                }
            }
            set
            {
                Debug.Assert(index >= 0);
                if (index != _lastAccessedIndex)
                {
                    int currentInt = this[index];
                    Debug.Assert(index == _lastAccessedIndex);
                }

                _lastAccessedElement.Int = value;
            }
        }
コード例 #22
0
 /// <include file='doc\DataGridViewIntLinkedList.uex' path='docs/doc[@for="DataGridViewIntLinkedList.BandAt"]/*' />
 public int this[int index]
 {
     get
     {
         Debug.Assert(index >= 0);
         Debug.Assert(index < this.count);
         if (this.lastAccessedIndex == -1 || index < this.lastAccessedIndex)
         {
             DataGridViewIntLinkedListElement tmp = this.headElement;
             int tmpIndex = index;
             while (tmpIndex > 0)
             {
                 tmp = tmp.Next;
                 tmpIndex--;
             }
             this.lastAccessedElement = tmp;
             this.lastAccessedIndex = index;
             return tmp.Int;
         }
         else
         {
             while (this.lastAccessedIndex < index)
             {
                 this.lastAccessedElement = this.lastAccessedElement.Next;
                 this.lastAccessedIndex++;
             }
             return this.lastAccessedElement.Int;
         }
     }
     set
     {
         Debug.Assert(index >= 0);
         if (index != this.lastAccessedIndex)
         {
             int currentInt = this[index];
             Debug.Assert(index == this.lastAccessedIndex);
         }
         this.lastAccessedElement.Int = value;
     }
 }
コード例 #23
0
 /// <include file='doc\DataGridViewIntLinkedList.uex' path='docs/doc[@for="DataGridViewIntLinkedListEnumerator.DataGridViewIntLinkedListEnumerator"]/*' />
 public DataGridViewIntLinkedListEnumerator(DataGridViewIntLinkedListElement headElement)
 {
     this.headElement = headElement;
     this.reset = true;
 }
コード例 #24
0
 void IEnumerator.Reset()
 {
     reset   = true;
     current = null;
 }
コード例 #25
0
 public DataGridViewIntLinkedListEnumerator(DataGridViewIntLinkedListElement headElement)
 {
     this.headElement = headElement;
     reset            = true;
 }
 public int this[int index]
 {
     get
     {
         if ((this.lastAccessedIndex != -1) && (index >= this.lastAccessedIndex))
         {
             while (this.lastAccessedIndex < index)
             {
                 this.lastAccessedElement = this.lastAccessedElement.Next;
                 this.lastAccessedIndex++;
             }
             return this.lastAccessedElement.Int;
         }
         DataGridViewIntLinkedListElement headElement = this.headElement;
         for (int i = index; i > 0; i--)
         {
             headElement = headElement.Next;
         }
         this.lastAccessedElement = headElement;
         this.lastAccessedIndex = index;
         return headElement.Int;
     }
     set
     {
         if (index != this.lastAccessedIndex)
         {
             int num1 = this[index];
         }
         this.lastAccessedElement.Int = value;
     }
 }
 public void RemoveAt(int index)
 {
     DataGridViewIntLinkedListElement element = null;
     DataGridViewIntLinkedListElement headElement = this.headElement;
     while (index > 0)
     {
         element = headElement;
         headElement = headElement.Next;
         index--;
     }
     DataGridViewIntLinkedListElement next = headElement.Next;
     if (element == null)
     {
         this.headElement = next;
     }
     else
     {
         element.Next = next;
     }
     this.count--;
     this.lastAccessedElement = null;
     this.lastAccessedIndex = -1;
 }
コード例 #28
0
 /// <include file='doc\DataGridViewIntLinkedList.uex' path='docs/doc[@for="DataGridViewIntLinkedListEnumerator.IEnumerator.MoveNext"]/*' />
 bool IEnumerator.MoveNext()
 {
     if (this.reset)
     {
         Debug.Assert(this.current == null);
         this.current = this.headElement;
         this.reset = false;
     }
     else
     {
         Debug.Assert(this.current != null); // Since this is for internal use only.
         this.current = this.current.Next;
     }
     return (this.current != null);
 }
コード例 #29
0
 /// <include file='doc\DataGridViewIntLinkedList.uex' path='docs/doc[@for="DataGridViewIntLinkedListEnumerator.IEnumerator.Reset"]/*' />
 void IEnumerator.Reset()
 {
     this.reset = true;
     this.current = null;
 }
 public bool Remove(int integer)
 {
     DataGridViewIntLinkedListElement element = null;
     DataGridViewIntLinkedListElement headElement = this.headElement;
     while (headElement != null)
     {
         if (headElement.Int == integer)
         {
             break;
         }
         element = headElement;
         headElement = headElement.Next;
     }
     if (headElement.Int != integer)
     {
         return false;
     }
     DataGridViewIntLinkedListElement next = headElement.Next;
     if (element == null)
     {
         this.headElement = next;
     }
     else
     {
         element.Next = next;
     }
     this.count--;
     this.lastAccessedElement = null;
     this.lastAccessedIndex = -1;
     return true;
 }
コード例 #31
0
 /// <include file='doc\DataGridViewIntLinkedList.uex' path='docs/doc[@for="DataGridViewIntLinkedList.RemoveAt"]/*' />
 public void RemoveAt(int index)
 {
     DataGridViewIntLinkedListElement tmp1 = null, tmp2 = this.headElement;
     while (index > 0)
     {
         tmp1 = tmp2;
         tmp2 = tmp2.Next;
         index--;
     }
     DataGridViewIntLinkedListElement tmp3 = tmp2.Next;
     if (tmp1 == null)
     {
         this.headElement = tmp3;
     }
     else
     {
         tmp1.Next = tmp3;
     }
     this.count--;
     this.lastAccessedElement = null;
     this.lastAccessedIndex = -1;
 }
コード例 #32
0
 /// <include file='doc\DataGridViewIntLinkedList.uex' path='docs/doc[@for="DataGridViewIntLinkedList.Remove"]/*' />
 public bool Remove(int integer)
 {
     DataGridViewIntLinkedListElement tmp1 = null, tmp2 = this.headElement;
     while (tmp2 != null)
     {
         if (tmp2.Int == integer)
         {
             break;
         }
         tmp1 = tmp2;
         tmp2 = tmp2.Next;
     }
     if (tmp2.Int == integer)
     {
         DataGridViewIntLinkedListElement tmp3 = tmp2.Next;
         if (tmp1 == null)
         {
             this.headElement = tmp3;
         }
         else
         {
             tmp1.Next = tmp3;
         }
         this.count--;
         this.lastAccessedElement = null;
         this.lastAccessedIndex = -1;
         return true;
     }
     return false;
 }
コード例 #33
0
 /// <include file='doc\DataGridViewIntLinkedList.uex' path='docs/doc[@for="DataGridViewIntLinkedList.Contains"]/*' />
 public bool Contains(int integer)
 {
     int index = 0;
     DataGridViewIntLinkedListElement tmp = this.headElement;
     while (tmp != null)
     {
         if (tmp.Int == integer)
         {
             this.lastAccessedElement = tmp;
             this.lastAccessedIndex = index;
             return true;
         }
         tmp = tmp.Next;
         index++;
     }
     return false;
 }
コード例 #34
0
 void IEnumerator.Reset()
 {
     this.reset   = true;
     this.current = null;
 }