title: .NET (non-visual) component
body: <p>I need to create a non-visual component, <code>FooComponent</code>, that will do some management for all controls of type <code>Bar</code> that resides in its form.</p>
  
  <p>I have the following constraints:</p>
  
  <ol>
  <li>The <code>FooComponent</code> can only be added to forms.</li>
  <li>Only one <code>FooComponent</code> per form is allowed.</li>
  <li><code>FooComponent</code> should register to the form closing event, and when it fires and to some function on all <code>Bar</code>'s and sent the <code>e.Cancel</code> value based on the returned values.</li>
  </ol>
  
  <p>#1 and #2 above should be enforced on run-time as well as design time.
  #3 event registration should be made automatically and not by the <code>FooComponent</code>'s users.</p>
  
  <p>I searched Google and MSDN for some help and read about <code>Component</code> and <code>ComponentDesigner</code> classes, but I didn't find anything for the rescue.</p>
  
  <p>What should I do?</p>