title: (Efficiently) expose OpenFileDialog properties to COM Interop
body: <p>I resell a product that uses VBS to enhance its forms. Showing an OpenFileDialog from VBS isn't trivial anymore since Vista (I believe, can't remember). However, with it I also optionally ship a .Net dll that uses COM Interop. So I thought it might be a nice idea to include a <code>FilePicker</code> in that.</p>
  
  <p>In this assembly I currently have the following (example) code, which works fine:</p>
  
  <pre><code>[ComVisible(true)]
  [ProgId("BlaBla.FilePicker")]
  [Guid("xxx-xxx-xxx-xxx")]
  [ClassInterface(ClassInterfaceType.None)]
  [ComDefaultInterface(typeof(IFilePicker))]
  public class FilePicker : IFilePicker
  {
      public string Show()
      {
          using (OpenFileDialog openFileDialog = new OpenFileDialog())
          {
              if (openFileDialog.ShowDialog() == DialogResult.OK)
              {
                  return openFileDialog.FileName;
              }
          }
          return string.Empty;
      }
  }
  </code></pre>
  
  <p>However, what I would like to do is expose (at least some) properties of the <code>OpenFileDialog</code> so that I can set initial locations and filters etc.</p>
  
  <p>That is proving to be surprisingly hard. <code>OpenFileDialog</code> is a sealed class and its base class <code>FileDialog</code> is not meant to be inherited from.</p>
  
  <p>I could simply expose the options by hardcoding them, in effect mimicking the <code>FileDialog</code> properties.</p>
  
  <p>But that seems rather inefficient. Ideally, I would like to simply inherit fom some base class or interface and just implement that.</p>
  
  <p>Is that feasible?</p>