title: DeepCopy A SortedDictionary
body: <p>I have the following :</p>
  
  <pre><code>SortedDictionary&lt;int, SortedDictionary&lt;int, VolumeInfoItem&gt;&gt;
  </code></pre>
  
  <p>that I want to deepcopy.</p>
  
  <p>VolumeInfoItem is the following class :</p>
  
  <pre><code>[Serializable]
  public class VolumeInfoItem
  {
      public double up = 0;
      public double down = 0;
      public double neutral = 0;
      public int dailyBars = 0;
  
  }
  </code></pre>
  
  <p>I have created the following Extension method :</p>
  
  <pre><code>public static T DeepClone&lt;T&gt;(this T a)
  {
      using (MemoryStream stream = new MemoryStream())
      {
          BinaryFormatter formatter = new BinaryFormatter();
          formatter.Serialize(stream, a);
          stream.Position = 0;
          return (T)formatter.Deserialize(stream);
      }
  }
  </code></pre>
  
  <p>I can't figure out how to get the deepCopy working ? </p>