title: Where to call Dispose() of IDisposable created in constructor?
body: <p>Where to call <code>Dispose()</code> for <code>IDisposable</code> objects owned by an object? </p>
  
  <pre><code>public class MyClass
  {
      public MyClass()
      {
          log = new EventLog { Source = "MyLogSource", Log = "MyLog" };
          FileStream stream = File.Open("MyFile.txt", FileMode.OpenOrCreate);
      }
  
  
      private readonly EventLog log;
      private readonly FileStream stream;
  
      // Other members, using the fields above
  }
  </code></pre>
  
  <p>Should I implement <a href="http://msdn.microsoft.com/en-us/library/system.object.finalize%28v=vs.110%29.aspx" rel="nofollow"><code>Finalize()</code></a> for this example? What if I do not implement anything at all? Will there be any problems?</p>
  
  <p>My first thought was that <code>MyClass</code> should implement <code>IDisposable</code>. But the following statement in <a href="http://msdn.microsoft.com/en-us/library/system.idisposable%28v=vs.110%29.aspx" rel="nofollow">an MSDN article</a> confused me:</p>
  
  <blockquote>
    <p>Implement IDisposable only if you are using unmanaged resources directly. If your app simply uses an object that implements
    IDisposable, don't provide an IDisposable implementation.</p>
  </blockquote>
  
  <p>Is this statement wrong?</p>