CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of MessageHandlers
C#
private static IEnumerable<Type> FindAllMessageHandlers()
{
    var iMessageHandler = typeof(IMessageHandler);
 
    var types = from type in AppDomain.CurrentDomain.GetAssemblies().SelectMany(t => t.GetTypes())
            let canInstantiate = !type.IsInterface && !type.IsAbstract && !type.IsNestedPrivate
            let isIMessageHandler = type.GetInterface(iMessageHandler.Name) != null
            where canInstantiate && isIMessageHandler
            select type;
by John Nelson   May 06, 2010 @ 7:03pm
295 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate