System.Collections.ArrayList.Clear C# (CSharp) Method

Clear() public method

public Clear ( ) : void
return void
        public virtual void Clear()
        {
            if (_size > 0)
            {
                Array.Clear(_items, 0, _size); // Don't need to doc this but we clear the elements so that the gc can reclaim the references.
                _size = 0;
            }
            _version++;
        }

Usage Example

Example #1
0
 /// <summary>
 /// Dispose the collection
 /// </summary>
 public void Dispose()
 {
     if (pArray != null)
     {
         pArray.Clear();
         pArray = null;
     }
 }
All Usage Examples Of System.Collections.ArrayList::Clear