diff options
| author | Rob Mensching <rob@firegiant.com> | 2017-10-14 16:12:07 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2017-10-14 16:12:07 -0700 |
| commit | dbde9e7104b907bbbaea17e21247d8cafc8b3a4c (patch) | |
| tree | 0f5fbbb6fe12c6b2e5e622a0e18ce4c5b4eb2b96 /src/WixToolset.Core/ExtensionManager.cs | |
| parent | fbf986eb97f68396797a89fc7d40dec07b775440 (diff) | |
| download | wix-dbde9e7104b907bbbaea17e21247d8cafc8b3a4c.tar.gz wix-dbde9e7104b907bbbaea17e21247d8cafc8b3a4c.tar.bz2 wix-dbde9e7104b907bbbaea17e21247d8cafc8b3a4c.zip | |
Massive refactoring to introduce the concept of IBackend
Diffstat (limited to 'src/WixToolset.Core/ExtensionManager.cs')
| -rw-r--r-- | src/WixToolset.Core/ExtensionManager.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/WixToolset.Core/ExtensionManager.cs b/src/WixToolset.Core/ExtensionManager.cs index 45cb65ec..7e40571b 100644 --- a/src/WixToolset.Core/ExtensionManager.cs +++ b/src/WixToolset.Core/ExtensionManager.cs | |||
| @@ -8,8 +8,9 @@ namespace WixToolset | |||
| 8 | using System.Linq; | 8 | using System.Linq; |
| 9 | using System.Reflection; | 9 | using System.Reflection; |
| 10 | using WixToolset.Data; | 10 | using WixToolset.Data; |
| 11 | using WixToolset.Extensibility; | ||
| 11 | 12 | ||
| 12 | public class ExtensionManager | 13 | public class ExtensionManager : IExtensionManager |
| 13 | { | 14 | { |
| 14 | private List<Assembly> extensionAssemblies = new List<Assembly>(); | 15 | private List<Assembly> extensionAssemblies = new List<Assembly>(); |
| 15 | 16 | ||
| @@ -67,8 +68,7 @@ namespace WixToolset | |||
| 67 | /// <returns>Extensions created of the specified type.</returns> | 68 | /// <returns>Extensions created of the specified type.</returns> |
| 68 | public IEnumerable<T> Create<T>() where T : class | 69 | public IEnumerable<T> Create<T>() where T : class |
| 69 | { | 70 | { |
| 70 | var extensionType = typeof(T); | 71 | var types = this.extensionAssemblies.SelectMany(a => a.GetTypes().Where(t => !t.IsAbstract && !t.IsInterface && typeof(T).IsAssignableFrom(t))); |
| 71 | var types = this.extensionAssemblies.SelectMany(a => a.GetTypes().Where(t => !t.IsAbstract && !t.IsInterface && extensionType.IsAssignableFrom(t))); | ||
| 72 | return types.Select(t => (T)Activator.CreateInstance(t)).ToList(); | 72 | return types.Select(t => (T)Activator.CreateInstance(t)).ToList(); |
| 73 | } | 73 | } |
| 74 | 74 | ||
