CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Language: C#

Extension method for grabbing assemblies from a catalog - Useful with DeploymentCatalog

407 Views
Copy Code Show/Hide Line Numbers
 
public static class CatalogExtensions
{
    public static IEnumerable<Assembly> ToAssemblies(this ComposablePartCatalog catalog)
    {
        return catalog.Parts.Select(p => ((Type) ReflectionModelServices.GetPartType(p).Value).Assembly).Distinct();
    }
}
 
 
by Glenn Block
  April 14, 2010 @ 1:28pm

Add a comment


Report Abuse
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