title: How to use IDisposable pattern on Windows Form
body: <p>I've read about IDisposable pattern on this <a href="http://lostechies.com/chrispatterson/2012/11/29/idisposable-done-right/" rel="noreferrer">article</a> and want to implement it in my windows form application. As we know that in windows form .Designer.cs class there is already Dispose method</p>
  
  <pre><code>private System.ComponentModel.IContainer components = null;
  
  protected override void Dispose(bool disposing)
  {
      if (disposing &amp;&amp; (components != null))
      {
          components.Dispose();
      }
      base.Dispose(disposing);
  }
  </code></pre>
  
  <p>and in .cs class I'm using Typed Dataset to read and save the data.</p>
  
  <pre><code>public partial class frmCustomerList
  {
      private MyTypedDataSet ds = new MyTypedDataSet();
      ...
  }
  </code></pre>
  
  <p>So, how to implement <code>IDisposable</code> to dispose MyTypedDataSet? If I implement <code>IDisposable</code> in frmCustomerList and implement its interface</p>
  
  <pre><code>public partial class frmCustomerList : IDisposable
  {
      private MyTypedDataSet ds = new MyTypedDataSet();
      void Dispose()
      {
         ds.Dispose();
      }
  }
  </code></pre>
  
  <p>what about <code>Dispose(bool disposing)</code> method in .Designer.cs?</p>