title: Array.Copy exception
body: <p>I'm trying to increase size of array using <code>Array</code>.Copy C# built in <code>static</code> method.
  Code is as follows:</p>
  
  <pre><code>public class MyClass
  {
      private int Capacity { get; set; }
      private int Size { get; set; }
      private int[] Nodes { get; set; }
  
      public MyClass()
      {
          Capacity = 5;
          Size = 0;
          Nodes = new int[Capacity];
      }
  
      public void EnlargeIfNeeded()
      {
          if (Size == Capacity)
          {
              Capacity = 2 * Capacity;
              Array.Copy(Nodes, Nodes, Capacity);
          }
      }
  }
  </code></pre>
  
  <p>It throws the following exception, when method <code>EnlargeIfNeeded()</code> is invoked:</p>
  
  <blockquote>
    <p>system.argument.exception: Source array was not long enough. Check
    srcIndex and length, and the array's lower bound</p>
  </blockquote>
  
  <p>Is it OK to use the following? My unit tests are passing OK, now:</p>
  
  <pre><code>    public void EnlargeIfNeeded()
      {
          if (Size == Capacity)
          {
              Capacity = 2 * Capacity;
              var dest = new int[Capacity];
              Array.Copy(Nodes, dest, Capacity/2);
              Nodes = dest;
          }
      }
  </code></pre>