System.Collections.ArrayList.Range.InternalUpdateVersion()

Here are the examples of the csharp api class System.Collections.ArrayList.Range.InternalUpdateVersion() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

20 Examples 7

1. Example

Project: referencesource
Source File: arraylist.cs
public override int Add(Object value) {
                InternalUpdateRange();
                _baseList.Insert(_baseIndex + _baseSize, value);
                InternalUpdateVersion();
                return _baseSize++;
            }

2. Example

Project: referencesource
Source File: arraylist.cs
public override void AddRange(ICollection c) {
                if( c ==  null ) {
                    throw new ArgumentNullException("c");
                }
                Contract.EndContractBlock();

                InternalUpdateRange();
                int count = c.Count;
                if( count > 0) {
                    _baseList.InsertRange(_baseIndex + _baseSize, c);
                    InternalUpdateVersion();
                    _baseSize += count;
                }
            }

3. Example

Project: referencesource
Source File: arraylist.cs
public override void Clear() {
                InternalUpdateRange();
                if (_baseSize != 0)
                {
                    _baseList.RemoveRange(_baseIndex, _baseSize);
                    InternalUpdateVersion();
                    _baseSize = 0;
                }
            }

4. Example

Project: referencesource
Source File: arraylist.cs
public override void Insert(int index, Object value) {
                if (index < 0 || index > _baseSize) throw new ArgumentOutOfRangeException("index", Environment.GetResourceString("ArgumentOutOfRange_Index"));
                Contract.EndContractBlock();

                InternalUpdateRange();
                _baseList.Insert(_baseIndex + index, value);
                InternalUpdateVersion();
                _baseSize++;
            }

5. Example

Project: referencesource
Source File: arraylist.cs
public override void InsertRange(int index, ICollection c) {
                if (index < 0 || index > _baseSize) throw new ArgumentOutOfRangeException("index", Environment.GetResourceString("ArgumentOutOfRange_Index"));
                if( c == null) {
                    throw new ArgumentNullException("c");
                }
                Contract.EndContractBlock();

                InternalUpdateRange();                
                int count = c.Count;
                if( count > 0) {
                    _baseList.InsertRange(_baseIndex + index, c);
                    _baseSize += count;                    
                    InternalUpdateVersion();
                }
            }

6. Example

Project: referencesource
Source File: arraylist.cs
public override void RemoveAt(int index) {
                if (index < 0 || index >= _baseSize) throw new ArgumentOutOfRangeException("index", Environment.GetResourceString("ArgumentOutOfRange_Index"));
                Contract.EndContractBlock();

                InternalUpdateRange();
                _baseList.RemoveAt(_baseIndex + index);
                InternalUpdateVersion();
                _baseSize--;
            }

7. Example

Project: referencesource
Source File: arraylist.cs
public override void RemoveRange(int index, int count) {            
                if (index < 0 || count < 0)
                    throw new ArgumentOutOfRangeException((index<0 ? "index" : "count"), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
                if (_baseSize - index < count)
                    throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
                Contract.EndContractBlock();

                InternalUpdateRange();
                // No need to call _bastList.RemoveRange if count is 0.
                // In addition, _baseList won't change the vresion number if count is 0. 
                if( count > 0) {
                    _baseList.RemoveRange(_baseIndex + index, count);
                    InternalUpdateVersion();
                    _baseSize -= count;
                }
            }

8. Example

Project: referencesource
Source File: arraylist.cs
public override void Reverse(int index, int count) {
                if (index < 0 || count < 0)
                    throw new ArgumentOutOfRangeException((index<0 ? "index" : "count"), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
                if (_baseSize - index < count)
                    throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
                Contract.EndContractBlock();

                InternalUpdateRange();
                _baseList.Reverse(_baseIndex + index, count);
                InternalUpdateVersion();
            }

9. Example

Project: referencesource
Source File: arraylist.cs
[SuppressMessage("Microsoft.Contracts", "CC1055")]  // Skip extra error checking to avoid *potential* AppCompat problems.
            public override void SetRange(int index, ICollection c) {
                InternalUpdateRange();
                if (index < 0 || index >= _baseSize) throw new ArgumentOutOfRangeException("index", Environment.GetResourceString("ArgumentOutOfRange_Index"));
                _baseList.SetRange(_baseIndex + index, c);
                if( c.Count > 0) {
                    InternalUpdateVersion();
                }
            }

10. Example

Project: referencesource
Source File: arraylist.cs
public override void Sort(int index, int count, IComparer comparer) {
                if (index < 0 || count < 0)
                    throw new ArgumentOutOfRangeException((index<0 ? "index" : "count"), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
                if (_baseSize - index < count)
                    throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
                Contract.EndContractBlock();

                InternalUpdateRange();
                _baseList.Sort(_baseIndex + index, count, comparer);
                InternalUpdateVersion();
            }

11. Example

Project: SharpLang
Source File: ArrayList.cs
public override int Add(Object value) {
                InternalUpdateRange();
                _baseList.Insert(_baseIndex + _baseSize, value);
                InternalUpdateVersion();
                return _baseSize++;
            }

12. Example

Project: SharpLang
Source File: ArrayList.cs
public override void Clear() {
                InternalUpdateRange();
                if (_baseSize != 0)
                {
                    _baseList.RemoveRange(_baseIndex, _baseSize);
                    InternalUpdateVersion();
                    _baseSize = 0;
                }
            }

13. Example

Project: SharpLang
Source File: ArrayList.cs
[SuppressMessage("Microsoft.Contracts", "CC1055")]  // Skip extra error checking to avoid *potential* AppCompat problems.
            public override void SetRange(int index, ICollection c) {
                InternalUpdateRange();
                if (index < 0 || index >= _baseSize) throw new ArgumentOutOfRangeException("index", Environment.GetResourceString("ArgumentOutOfRange_Index"));
                _baseList.SetRange(_baseIndex + index, c);
                if( c.Count > 0) {
                    InternalUpdateVersion();
                }
            }

14. Example

Project: SharpLang
Source File: ArrayList.cs
public override void AddRange(ICollection c) {
                if( c ==  null ) {
                    throw new ArgumentNullException("c");
                }
                Contract.EndContractBlock();

                InternalUpdateRange();
                int count = c.Count;
                if( count > 0) {
                    _baseList.InsertRange(_baseIndex + _baseSize, c);
                    InternalUpdateVersion();
                    _baseSize += count;
                }
            }

15. Example

Project: SharpLang
Source File: ArrayList.cs
public override void Insert(int index, Object value) {
                if (index < 0 || index > _baseSize) throw new ArgumentOutOfRangeException("index", Environment.GetResourceString("ArgumentOutOfRange_Index"));
                Contract.EndContractBlock();

                InternalUpdateRange();
                _baseList.Insert(_baseIndex + index, value);
                InternalUpdateVersion();
                _baseSize++;
            }

16. Example

Project: SharpLang
Source File: ArrayList.cs
public override void InsertRange(int index, ICollection c) {
                if (index < 0 || index > _baseSize) throw new ArgumentOutOfRangeException("index", Environment.GetResourceString("ArgumentOutOfRange_Index"));
                if( c == null) {
                    throw new ArgumentNullException("c");
                }
                Contract.EndContractBlock();

                InternalUpdateRange();                
                int count = c.Count;
                if( count > 0) {
                    _baseList.InsertRange(_baseIndex + index, c);
                    _baseSize += count;                    
                    InternalUpdateVersion();
                }
            }

17. Example

Project: SharpLang
Source File: ArrayList.cs
public override void RemoveAt(int index) {
                if (index < 0 || index >= _baseSize) throw new ArgumentOutOfRangeException("index", Environment.GetResourceString("ArgumentOutOfRange_Index"));
                Contract.EndContractBlock();

                InternalUpdateRange();
                _baseList.RemoveAt(_baseIndex + index);
                InternalUpdateVersion();
                _baseSize--;
            }

18. Example

Project: SharpLang
Source File: ArrayList.cs
public override void RemoveRange(int index, int count) {            
                if (index < 0 || count < 0)
                    throw new ArgumentOutOfRangeException((index<0 ? "index" : "count"), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
                if (_baseSize - index < count)
                    throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
                Contract.EndContractBlock();

                InternalUpdateRange();
                // No need to call _bastList.RemoveRange if count is 0.
                // In addition, _baseList won't change the vresion number if count is 0. 
                if( count > 0) {
                    _baseList.RemoveRange(_baseIndex + index, count);
                    InternalUpdateVersion();
                    _baseSize -= count;
                }
            }

19. Example

Project: SharpLang
Source File: ArrayList.cs
public override void Reverse(int index, int count) {
                if (index < 0 || count < 0)
                    throw new ArgumentOutOfRangeException((index<0 ? "index" : "count"), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
                if (_baseSize - index < count)
                    throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
                Contract.EndContractBlock();

                InternalUpdateRange();
                _baseList.Reverse(_baseIndex + index, count);
                InternalUpdateVersion();
            }

20. Example

Project: SharpLang
Source File: ArrayList.cs
public override void Sort(int index, int count, IComparer comparer) {
                if (index < 0 || count < 0)
                    throw new ArgumentOutOfRangeException((index<0 ? "index" : "count"), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
                if (_baseSize - index < count)
                    throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
                Contract.EndContractBlock();

                InternalUpdateRange();
                _baseList.Sort(_baseIndex + index, count, comparer);
                InternalUpdateVersion();
            }