Beispiel #1
0
        internal string[] LoadExtensionsFromFolder(string folderPath)
        {
            if (!Directory.Exists(folderPath))
            {
                return(new string[0]);
            }

            SafeDirectoryCatalog directoryCatalog = new SafeDirectoryCatalog(folderPath);

            var catalog = new AggregateCatalog(
                new AssemblyCatalog(Assembly.GetExecutingAssembly()),
                directoryCatalog);
            var batch = new CompositionBatch();

            batch.AddPart(this);

            CompositionContainer container = new CompositionContainer(catalog);

            container.Compose(batch);
            return(directoryCatalog.FailedAssemblies);
        }
Beispiel #2
0
        internal string[] LoadExtensionsFromFolder(string folderPath)
        {
            if (!Directory.Exists(folderPath)) return new string[0];

            SafeDirectoryCatalog directoryCatalog = new SafeDirectoryCatalog(folderPath);

            var catalog = new AggregateCatalog(
                new AssemblyCatalog(Assembly.GetExecutingAssembly()),
                directoryCatalog);
            var batch = new CompositionBatch();
            batch.AddPart(this);

            CompositionContainer container = new CompositionContainer(catalog);
            container.Compose(batch);
            return directoryCatalog.FailedAssemblies;
        }