title: Castle Windsor resolve by class attribute
body: <p>I'm designing a system capable of processing both typed &amp; xml based messages based on a specific (string based) MessageType. Ideally to handle these messages I'd like to use a series of providers such as:</p>
  
  <pre><code>[MessageType("CreateWorkOrder")]
  public class CreateWorkOrderMessageProcessingProvider: IMessageProcessingProvider
  {
      ...
  </code></pre>
  
  <p>and then resolve by name 'CreateWorkOrder' within Windsor. I'm wondering if it's possible to register by name (using MessageType attribute) using a variation of:  </p>
  
  <pre><code>container.Register(Classes.FromAssemblyContaining&lt;IMessageProcessingProvider&gt;().Where(t =&gt; Attribute.IsDefined(t, typeof(MessageTypeAttribute))));
  </code></pre>
  
  <p>or am I required to provide a custom resolver?. If there is a better pattern to implement here I'd be happy to hear it.</p>