title: How to convert a try-catch-finally block to using statement in c#?
body: <p>Say we create a IDisposable object, and we have a try-catch-finally block</p>
  
  <pre><code>var disposable= CreateIDisposable();
  try{
    // do something with the disposable.
  }catch(Exception e){
    // do something with the exception
  }finally{
    disposable.Dispose();
  }
  </code></pre>
  
  <p>How do I convert this to a using block?</p>
  
  <p>If it were</p>
  
  <pre><code>var disposable= CreateIDisposable();
  try{
    // do something with the disposable.
  }finally{
    disposable.Dispose();
  }
  </code></pre>
  
  <p>I would convert to</p>
  
  <pre><code>using(var disposable= CreateIDisposable()){
       // do something with the disposable.
  }
  </code></pre>
  
  <p>How would I do this with the catch block?</p>
  
  <pre><code>try{
    using(var disposable= CreateIDisposable()){
       // do something with the disposable.
     }
  }catch(Exception e){
    // do something with the exception
  }
  </code></pre>