Lazy Loading DLL's with MEF

I'm doing my first project with MEF and am seriously unable to understand how to use lazy loading. My code is -

public static class MefLoader
{
     private static CompositionContainer Container;

    [ImportMany(typeof(IControlModule), AllowRecomposition = true)]
    private static IEnumerable<Lazy<IControlModule, IImportComponentCapabilites>> 
               DllList { get; set; }

    static MefLoader()
    {
        var catalog = new AggregateCatalog();
        catalog.Catalogs.Add(new DirectoryCatalog("."));
        Container = new CompositionContainer(catalog);

    }

I understand most of how to use MEF, except that I don't see how to initialize the DllList object. I want to use lazy loading because in final system, we have a great many options and only about 10% are going to be used at any one time.

5
задан photo_tom 6 December 2010 в 22:23
поделиться