System.LocalDataStore.SetCapacity C# (CSharp) Method

SetCapacity() private method

private SetCapacity ( int capacity ) : void
capacity int
return void
		private void SetCapacity(int capacity)
		{
			// Validate that the specified capacity is larger than the current one.
			if (capacity < m_DataTable.Length)
			throw new ArgumentException(Environment.GetResourceString("Argument_ALSInvalidCapacity"));
		            
			// Allocate the new data table.
			Object[] NewDataTable = new Object[capacity];
		            
			// Copy all the objects into the new table.
			Array.Copy(m_DataTable, NewDataTable, m_DataTable.Length);
		            
			// Save the new table.
			m_DataTable = NewDataTable;
		}        
	}