Beispiel #1
0
        private void loadModuleDLLs(MicroXDeviceManager parent)
        {
            //An aggregate catalog that combines multiple catalogs
            var catalog = new AggregateCatalog();

            //Adds all the parts found in the same assembly as the Program class
            catalog.Catalogs.Add(new DirectoryCatalog(".\\Modules", "Module*"));
            //Create the CompositionContainer with the parts in the catalog
            _container = new CompositionContainer(catalog);

            //Fill the imports of this object
            try
            {
                _container.ComposeExportedValue(parent as IDeviceManager);
                _container.ComposeParts(this);
                goOverModules();
            }
            catch (CompositionException compositionException)
            {
                Log.Write(compositionException);
            }
            catch (ReflectionTypeLoadException ex)
            {
                Log.Write(ex);
            }
        }
Beispiel #2
0
 internal static void Start(MicroXDeviceManager parent)
 {
     instance.loadModuleDLLs(parent);
 }