diff options
author | Rob Mensching <rob@firegiant.com> | 2021-04-19 16:12:28 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2021-04-19 16:37:03 -0700 |
commit | 7f4c41fc2c6ce55f8f1b87a5516573d99a9beec0 (patch) | |
tree | bf62fa354b7ebbf6eb25cc5af1f6bbbb7ce80fe6 | |
parent | bb40dc8a911ec0679016cbbf7132ea813ea1a3ad (diff) | |
download | wix-7f4c41fc2c6ce55f8f1b87a5516573d99a9beec0.tar.gz wix-7f4c41fc2c6ce55f8f1b87a5516573d99a9beec0.tar.bz2 wix-7f4c41fc2c6ce55f8f1b87a5516573d99a9beec0.zip |
Prefer IReadOnlyCollection<> or IReadOnlyList<> over IEnumerable<>
Closes wixtoolset/issues#6422
30 files changed, 58 insertions, 58 deletions
diff --git a/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs b/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs index 37fc17f9..d8062008 100644 --- a/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs +++ b/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs | |||
@@ -73,9 +73,9 @@ namespace WixToolset.Core.Burn | |||
73 | 73 | ||
74 | private IVariableResolver VariableResolver { get; } | 74 | private IVariableResolver VariableResolver { get; } |
75 | 75 | ||
76 | public IEnumerable<IFileTransfer> FileTransfers { get; private set; } | 76 | public IReadOnlyCollection<IFileTransfer> FileTransfers { get; private set; } |
77 | 77 | ||
78 | public IEnumerable<ITrackedFile> TrackedFiles { get; private set; } | 78 | public IReadOnlyCollection<ITrackedFile> TrackedFiles { get; private set; } |
79 | 79 | ||
80 | public WixOutput Wixout { get; private set; } | 80 | public WixOutput Wixout { get; private set; } |
81 | 81 | ||
diff --git a/src/WixToolset.Core.Burn/ExtensibilityServices/BurnBackendHelper.cs b/src/WixToolset.Core.Burn/ExtensibilityServices/BurnBackendHelper.cs index a4f37d10..e4d2b0c9 100644 --- a/src/WixToolset.Core.Burn/ExtensibilityServices/BurnBackendHelper.cs +++ b/src/WixToolset.Core.Burn/ExtensibilityServices/BurnBackendHelper.cs | |||
@@ -46,7 +46,7 @@ namespace WixToolset.Core.Burn.ExtensibilityServices | |||
46 | 46 | ||
47 | public IResolvedDirectory CreateResolvedDirectory(string directoryParent, string name) => this.backendHelper.CreateResolvedDirectory(directoryParent, name); | 47 | public IResolvedDirectory CreateResolvedDirectory(string directoryParent, string name) => this.backendHelper.CreateResolvedDirectory(directoryParent, name); |
48 | 48 | ||
49 | public IEnumerable<ITrackedFile> ExtractEmbeddedFiles(IEnumerable<IExpectedExtractFile> embeddedFiles) => this.backendHelper.ExtractEmbeddedFiles(embeddedFiles); | 49 | public IReadOnlyList<ITrackedFile> ExtractEmbeddedFiles(IEnumerable<IExpectedExtractFile> embeddedFiles) => this.backendHelper.ExtractEmbeddedFiles(embeddedFiles); |
50 | 50 | ||
51 | public string GenerateIdentifier(string prefix, params string[] args) => this.backendHelper.GenerateIdentifier(prefix, args); | 51 | public string GenerateIdentifier(string prefix, params string[] args) => this.backendHelper.GenerateIdentifier(prefix, args); |
52 | 52 | ||
diff --git a/src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerExtensionCommandLine.cs b/src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerExtensionCommandLine.cs index 76587830..2a603adf 100644 --- a/src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerExtensionCommandLine.cs +++ b/src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerExtensionCommandLine.cs | |||
@@ -21,7 +21,7 @@ namespace WixToolset.Core.ExtensionCache | |||
21 | 21 | ||
22 | private IServiceProvider ServiceProvider { get; } | 22 | private IServiceProvider ServiceProvider { get; } |
23 | 23 | ||
24 | public override IEnumerable<ExtensionCommandLineSwitch> CommandLineSwitches => new ExtensionCommandLineSwitch[] | 24 | public override IReadOnlyCollection<ExtensionCommandLineSwitch> CommandLineSwitches => new ExtensionCommandLineSwitch[] |
25 | { | 25 | { |
26 | new ExtensionCommandLineSwitch { Switch = "extension", Description = "Manage extension cache." }, | 26 | new ExtensionCommandLineSwitch { Switch = "extension", Description = "Manage extension cache." }, |
27 | }; | 27 | }; |
diff --git a/src/WixToolset.Core.WindowsInstaller/ExtensibilityServices/WindowsInstallerBackendHelper.cs b/src/WixToolset.Core.WindowsInstaller/ExtensibilityServices/WindowsInstallerBackendHelper.cs index ca1cd0e3..8305b5e6 100644 --- a/src/WixToolset.Core.WindowsInstaller/ExtensibilityServices/WindowsInstallerBackendHelper.cs +++ b/src/WixToolset.Core.WindowsInstaller/ExtensibilityServices/WindowsInstallerBackendHelper.cs | |||
@@ -37,7 +37,7 @@ namespace WixToolset.Core.WindowsInstaller.ExtensibilityServices | |||
37 | 37 | ||
38 | public IResolvedDirectory CreateResolvedDirectory(string directoryParent, string name) => this.backendHelper.CreateResolvedDirectory(directoryParent, name); | 38 | public IResolvedDirectory CreateResolvedDirectory(string directoryParent, string name) => this.backendHelper.CreateResolvedDirectory(directoryParent, name); |
39 | 39 | ||
40 | public IEnumerable<ITrackedFile> ExtractEmbeddedFiles(IEnumerable<IExpectedExtractFile> embeddedFiles) => this.backendHelper.ExtractEmbeddedFiles(embeddedFiles); | 40 | public IReadOnlyList<ITrackedFile> ExtractEmbeddedFiles(IEnumerable<IExpectedExtractFile> embeddedFiles) => this.backendHelper.ExtractEmbeddedFiles(embeddedFiles); |
41 | 41 | ||
42 | public string GenerateIdentifier(string prefix, params string[] args) => this.backendHelper.GenerateIdentifier(prefix, args); | 42 | public string GenerateIdentifier(string prefix, params string[] args) => this.backendHelper.GenerateIdentifier(prefix, args); |
43 | 43 | ||
diff --git a/src/WixToolset.Core/Bind/ExtractEmbeddedFiles.cs b/src/WixToolset.Core/Bind/ExtractEmbeddedFiles.cs index 35c8a2f0..a0798e62 100644 --- a/src/WixToolset.Core/Bind/ExtractEmbeddedFiles.cs +++ b/src/WixToolset.Core/Bind/ExtractEmbeddedFiles.cs | |||
@@ -50,7 +50,7 @@ namespace WixToolset.Core.Bind | |||
50 | return extractPath; | 50 | return extractPath; |
51 | } | 51 | } |
52 | 52 | ||
53 | public IEnumerable<ExpectedExtractFile> GetExpectedEmbeddedFiles() | 53 | public IReadOnlyList<ExpectedExtractFile> GetExpectedEmbeddedFiles() |
54 | { | 54 | { |
55 | var files = new List<ExpectedExtractFile>(); | 55 | var files = new List<ExpectedExtractFile>(); |
56 | 56 | ||
diff --git a/src/WixToolset.Core/Bind/ExtractEmbeddedFilesCommand.cs b/src/WixToolset.Core/Bind/ExtractEmbeddedFilesCommand.cs index 981a991f..ec2d8896 100644 --- a/src/WixToolset.Core/Bind/ExtractEmbeddedFilesCommand.cs +++ b/src/WixToolset.Core/Bind/ExtractEmbeddedFilesCommand.cs | |||
@@ -17,7 +17,7 @@ namespace WixToolset.Core.Bind | |||
17 | this.FilesWithEmbeddedFiles = embeddedFiles; | 17 | this.FilesWithEmbeddedFiles = embeddedFiles; |
18 | } | 18 | } |
19 | 19 | ||
20 | public IEnumerable<ITrackedFile> TrackedFiles { get; private set; } | 20 | public IReadOnlyList<ITrackedFile> TrackedFiles { get; private set; } |
21 | 21 | ||
22 | private IBackendHelper BackendHelper { get; } | 22 | private IBackendHelper BackendHelper { get; } |
23 | 23 | ||
diff --git a/src/WixToolset.Core/Bind/ResolveFieldsCommand.cs b/src/WixToolset.Core/Bind/ResolveFieldsCommand.cs index 2738ac6c..794208e5 100644 --- a/src/WixToolset.Core/Bind/ResolveFieldsCommand.cs +++ b/src/WixToolset.Core/Bind/ResolveFieldsCommand.cs | |||
@@ -36,7 +36,7 @@ namespace WixToolset.Core.Bind | |||
36 | 36 | ||
37 | public bool AllowUnresolvedVariables { private get; set; } | 37 | public bool AllowUnresolvedVariables { private get; set; } |
38 | 38 | ||
39 | public IEnumerable<DelayedField> DelayedFields { get; private set; } | 39 | public IReadOnlyCollection<DelayedField> DelayedFields { get; private set; } |
40 | 40 | ||
41 | public void Execute() | 41 | public void Execute() |
42 | { | 42 | { |
diff --git a/src/WixToolset.Core/BindContext.cs b/src/WixToolset.Core/BindContext.cs index 09454824..052382f1 100644 --- a/src/WixToolset.Core/BindContext.cs +++ b/src/WixToolset.Core/BindContext.cs | |||
@@ -18,7 +18,7 @@ namespace WixToolset.Core | |||
18 | 18 | ||
19 | public IServiceProvider ServiceProvider { get; } | 19 | public IServiceProvider ServiceProvider { get; } |
20 | 20 | ||
21 | public IEnumerable<BindPath> BindPaths { get; set; } | 21 | public IReadOnlyCollection<BindPath> BindPaths { get; set; } |
22 | 22 | ||
23 | public string BurnStubPath { get; set; } | 23 | public string BurnStubPath { get; set; } |
24 | 24 | ||
@@ -28,15 +28,15 @@ namespace WixToolset.Core | |||
28 | 28 | ||
29 | public CompressionLevel? DefaultCompressionLevel { get; set; } | 29 | public CompressionLevel? DefaultCompressionLevel { get; set; } |
30 | 30 | ||
31 | public IEnumerable<IDelayedField> DelayedFields { get; set; } | 31 | public IReadOnlyCollection<IDelayedField> DelayedFields { get; set; } |
32 | 32 | ||
33 | public IEnumerable<IExpectedExtractFile> ExpectedEmbeddedFiles { get; set; } | 33 | public IReadOnlyCollection<IExpectedExtractFile> ExpectedEmbeddedFiles { get; set; } |
34 | 34 | ||
35 | public IEnumerable<IBinderExtension> Extensions { get; set; } | 35 | public IReadOnlyCollection<IBinderExtension> Extensions { get; set; } |
36 | 36 | ||
37 | public IEnumerable<IFileSystemExtension> FileSystemExtensions { get; set; } | 37 | public IReadOnlyCollection<IFileSystemExtension> FileSystemExtensions { get; set; } |
38 | 38 | ||
39 | public IEnumerable<string> Ices { get; set; } | 39 | public IReadOnlyCollection<string> Ices { get; set; } |
40 | 40 | ||
41 | public string IntermediateFolder { get; set; } | 41 | public string IntermediateFolder { get; set; } |
42 | 42 | ||
@@ -54,7 +54,7 @@ namespace WixToolset.Core | |||
54 | 54 | ||
55 | public int? ResolvedLcid { get; set; } | 55 | public int? ResolvedLcid { get; set; } |
56 | 56 | ||
57 | public IEnumerable<string> SuppressIces { get; set; } | 57 | public IReadOnlyCollection<string> SuppressIces { get; set; } |
58 | 58 | ||
59 | public bool SuppressValidation { get; set; } | 59 | public bool SuppressValidation { get; set; } |
60 | 60 | ||
diff --git a/src/WixToolset.Core/BindResult.cs b/src/WixToolset.Core/BindResult.cs index 4edade7a..9785484c 100644 --- a/src/WixToolset.Core/BindResult.cs +++ b/src/WixToolset.Core/BindResult.cs | |||
@@ -11,9 +11,9 @@ namespace WixToolset.Core | |||
11 | { | 11 | { |
12 | private bool disposed; | 12 | private bool disposed; |
13 | 13 | ||
14 | public IEnumerable<IFileTransfer> FileTransfers { get; set; } | 14 | public IReadOnlyCollection<IFileTransfer> FileTransfers { get; set; } |
15 | 15 | ||
16 | public IEnumerable<ITrackedFile> TrackedFiles { get; set; } | 16 | public IReadOnlyCollection<ITrackedFile> TrackedFiles { get; set; } |
17 | 17 | ||
18 | public WixOutput Wixout { get; set; } | 18 | public WixOutput Wixout { get; set; } |
19 | 19 | ||
diff --git a/src/WixToolset.Core/Binder.cs b/src/WixToolset.Core/Binder.cs index 090b5d32..204ab6ee 100644 --- a/src/WixToolset.Core/Binder.cs +++ b/src/WixToolset.Core/Binder.cs | |||
@@ -58,7 +58,7 @@ namespace WixToolset.Core | |||
58 | 58 | ||
59 | var backendFactories = extensionManager.GetServices<IBackendFactory>(); | 59 | var backendFactories = extensionManager.GetServices<IBackendFactory>(); |
60 | 60 | ||
61 | var entrySection = context.IntermediateRepresentation.Sections[0]; | 61 | var entrySection = context.IntermediateRepresentation.Sections.First(); |
62 | 62 | ||
63 | foreach (var factory in backendFactories) | 63 | foreach (var factory in backendFactories) |
64 | { | 64 | { |
diff --git a/src/WixToolset.Core/CommandLine/BuildCommand.cs b/src/WixToolset.Core/CommandLine/BuildCommand.cs index 59aa2f1f..5f618b81 100644 --- a/src/WixToolset.Core/CommandLine/BuildCommand.cs +++ b/src/WixToolset.Core/CommandLine/BuildCommand.cs | |||
@@ -216,7 +216,7 @@ namespace WixToolset.Core.CommandLine | |||
216 | } | 216 | } |
217 | } | 217 | } |
218 | 218 | ||
219 | private IEnumerable<Intermediate> CompilePhase(IDictionary<string, string> preprocessorVariables, IEnumerable<SourceFile> sourceFiles, CancellationToken cancellationToken) | 219 | private IReadOnlyList<Intermediate> CompilePhase(IDictionary<string, string> preprocessorVariables, IEnumerable<SourceFile> sourceFiles, CancellationToken cancellationToken) |
220 | { | 220 | { |
221 | var intermediates = new List<Intermediate>(); | 221 | var intermediates = new List<Intermediate>(); |
222 | 222 | ||
@@ -257,7 +257,7 @@ namespace WixToolset.Core.CommandLine | |||
257 | return intermediates; | 257 | return intermediates; |
258 | } | 258 | } |
259 | 259 | ||
260 | private Intermediate LibraryPhase(IEnumerable<Intermediate> intermediates, IEnumerable<Localization> localizations, bool bindFiles, IEnumerable<IBindPath> bindPaths, CancellationToken cancellationToken) | 260 | private Intermediate LibraryPhase(IReadOnlyCollection<Intermediate> intermediates, IReadOnlyCollection<Localization> localizations, bool bindFiles, IReadOnlyCollection<IBindPath> bindPaths, CancellationToken cancellationToken) |
261 | { | 261 | { |
262 | var context = this.ServiceProvider.GetService<ILibraryContext>(); | 262 | var context = this.ServiceProvider.GetService<ILibraryContext>(); |
263 | context.BindFiles = bindFiles; | 263 | context.BindFiles = bindFiles; |
@@ -302,7 +302,7 @@ namespace WixToolset.Core.CommandLine | |||
302 | return linker.Link(context); | 302 | return linker.Link(context); |
303 | } | 303 | } |
304 | 304 | ||
305 | private void BindPhase(Intermediate output, IEnumerable<Localization> localizations, IEnumerable<string> filterCultures, string cabCachePath, IEnumerable<IBindPath> bindPaths, CancellationToken cancellationToken) | 305 | private void BindPhase(Intermediate output, IReadOnlyCollection<Localization> localizations, IReadOnlyCollection<string> filterCultures, string cabCachePath, IReadOnlyCollection<IBindPath> bindPaths, CancellationToken cancellationToken) |
306 | { | 306 | { |
307 | var intermediateFolder = this.IntermediateFolder; | 307 | var intermediateFolder = this.IntermediateFolder; |
308 | if (String.IsNullOrEmpty(intermediateFolder)) | 308 | if (String.IsNullOrEmpty(intermediateFolder)) |
@@ -405,7 +405,7 @@ namespace WixToolset.Core.CommandLine | |||
405 | return Array.Empty<Intermediate>(); | 405 | return Array.Empty<Intermediate>(); |
406 | } | 406 | } |
407 | 407 | ||
408 | private IEnumerable<Localization> LoadLocalizationFiles(IEnumerable<string> locFiles, IDictionary<string, string> preprocessorVariables, CancellationToken cancellationToken) | 408 | private IReadOnlyList<Localization> LoadLocalizationFiles(IEnumerable<string> locFiles, IDictionary<string, string> preprocessorVariables, CancellationToken cancellationToken) |
409 | { | 409 | { |
410 | var localizations = new List<Localization>(); | 410 | var localizations = new List<Localization>(); |
411 | var parser = this.ServiceProvider.GetService<ILocalizationParser>(); | 411 | var parser = this.ServiceProvider.GetService<ILocalizationParser>(); |
@@ -787,7 +787,7 @@ namespace WixToolset.Core.CommandLine | |||
787 | return Data.OutputType.Unknown; | 787 | return Data.OutputType.Unknown; |
788 | } | 788 | } |
789 | 789 | ||
790 | public IEnumerable<string> CalculateFilterCultures() | 790 | public IReadOnlyList<string> CalculateFilterCultures() |
791 | { | 791 | { |
792 | var result = new List<string>(); | 792 | var result = new List<string>(); |
793 | 793 | ||
diff --git a/src/WixToolset.Core/CommandLine/CompileCommand.cs b/src/WixToolset.Core/CommandLine/CompileCommand.cs index 54d1b6f1..6e31b241 100644 --- a/src/WixToolset.Core/CommandLine/CompileCommand.cs +++ b/src/WixToolset.Core/CommandLine/CompileCommand.cs | |||
@@ -42,7 +42,7 @@ namespace WixToolset.Core.CommandLine | |||
42 | 42 | ||
43 | private Platform Platform { get; } | 43 | private Platform Platform { get; } |
44 | 44 | ||
45 | public IEnumerable<string> IncludeSearchPaths { get; } | 45 | public IReadOnlyCollection<string> IncludeSearchPaths { get; } |
46 | 46 | ||
47 | public bool ShowLogo => throw new NotImplementedException(); | 47 | public bool ShowLogo => throw new NotImplementedException(); |
48 | 48 | ||
diff --git a/src/WixToolset.Core/CompileContext.cs b/src/WixToolset.Core/CompileContext.cs index 2aeb3998..d84d7aac 100644 --- a/src/WixToolset.Core/CompileContext.cs +++ b/src/WixToolset.Core/CompileContext.cs | |||
@@ -21,7 +21,7 @@ namespace WixToolset.Core | |||
21 | 21 | ||
22 | public string CompilationId { get; set; } | 22 | public string CompilationId { get; set; } |
23 | 23 | ||
24 | public IEnumerable<ICompilerExtension> Extensions { get; set; } | 24 | public IReadOnlyCollection<ICompilerExtension> Extensions { get; set; } |
25 | 25 | ||
26 | public Platform Platform { get; set; } | 26 | public Platform Platform { get; set; } |
27 | 27 | ||
diff --git a/src/WixToolset.Core/CompilerCore.cs b/src/WixToolset.Core/CompilerCore.cs index 8705cacd..727084eb 100644 --- a/src/WixToolset.Core/CompilerCore.cs +++ b/src/WixToolset.Core/CompilerCore.cs | |||
@@ -1048,7 +1048,7 @@ namespace WixToolset.Core | |||
1048 | { | 1048 | { |
1049 | var section = new IntermediateSection(id, type, compilationId); | 1049 | var section = new IntermediateSection(id, type, compilationId); |
1050 | 1050 | ||
1051 | this.intermediate.Sections.Add(section); | 1051 | this.intermediate.AddSection(section); |
1052 | 1052 | ||
1053 | return section; | 1053 | return section; |
1054 | } | 1054 | } |
diff --git a/src/WixToolset.Core/DecompileContext.cs b/src/WixToolset.Core/DecompileContext.cs index 056785d6..a7ec03fd 100644 --- a/src/WixToolset.Core/DecompileContext.cs +++ b/src/WixToolset.Core/DecompileContext.cs | |||
@@ -22,7 +22,7 @@ namespace WixToolset.Core | |||
22 | 22 | ||
23 | public OutputType DecompileType { get; set; } | 23 | public OutputType DecompileType { get; set; } |
24 | 24 | ||
25 | public IEnumerable<IDecompilerExtension> Extensions { get; set; } | 25 | public IReadOnlyCollection<IDecompilerExtension> Extensions { get; set; } |
26 | 26 | ||
27 | public string ExtractFolder { get; set; } | 27 | public string ExtractFolder { get; set; } |
28 | 28 | ||
diff --git a/src/WixToolset.Core/DecompileResult.cs b/src/WixToolset.Core/DecompileResult.cs index 8c9285ba..fc24cab7 100644 --- a/src/WixToolset.Core/DecompileResult.cs +++ b/src/WixToolset.Core/DecompileResult.cs | |||
@@ -11,7 +11,7 @@ namespace WixToolset.Core | |||
11 | { | 11 | { |
12 | public XDocument Document { get; set; } | 12 | public XDocument Document { get; set; } |
13 | 13 | ||
14 | public IEnumerable<string> ExtractedFilePaths { get; set; } | 14 | public IReadOnlyCollection<string> ExtractedFilePaths { get; set; } |
15 | 15 | ||
16 | public Platform? Platform { get; set; } | 16 | public Platform? Platform { get; set; } |
17 | } | 17 | } |
diff --git a/src/WixToolset.Core/ExtensibilityServices/BackendHelper.cs b/src/WixToolset.Core/ExtensibilityServices/BackendHelper.cs index 539cec78..cfa78623 100644 --- a/src/WixToolset.Core/ExtensibilityServices/BackendHelper.cs +++ b/src/WixToolset.Core/ExtensibilityServices/BackendHelper.cs | |||
@@ -73,7 +73,7 @@ namespace WixToolset.Core.ExtensibilityServices | |||
73 | }; | 73 | }; |
74 | } | 74 | } |
75 | 75 | ||
76 | public IEnumerable<ITrackedFile> ExtractEmbeddedFiles(IEnumerable<IExpectedExtractFile> embeddedFiles) | 76 | public IReadOnlyList<ITrackedFile> ExtractEmbeddedFiles(IEnumerable<IExpectedExtractFile> embeddedFiles) |
77 | { | 77 | { |
78 | var command = new ExtractEmbeddedFilesCommand(this, embeddedFiles); | 78 | var command = new ExtractEmbeddedFilesCommand(this, embeddedFiles); |
79 | command.Execute(); | 79 | command.Execute(); |
diff --git a/src/WixToolset.Core/ExtensibilityServices/ExtensionManager.cs b/src/WixToolset.Core/ExtensibilityServices/ExtensionManager.cs index 31184c33..2340ed9e 100644 --- a/src/WixToolset.Core/ExtensibilityServices/ExtensionManager.cs +++ b/src/WixToolset.Core/ExtensibilityServices/ExtensionManager.cs | |||
@@ -94,7 +94,7 @@ namespace WixToolset.Core.ExtensibilityServices | |||
94 | } | 94 | } |
95 | } | 95 | } |
96 | 96 | ||
97 | public IEnumerable<T> GetServices<T>() where T : class | 97 | public IReadOnlyCollection<T> GetServices<T>() where T : class |
98 | { | 98 | { |
99 | if (!this.loadedExtensionsByType.TryGetValue(typeof(T), out var extensions)) | 99 | if (!this.loadedExtensionsByType.TryGetValue(typeof(T), out var extensions)) |
100 | { | 100 | { |
diff --git a/src/WixToolset.Core/LayoutContext.cs b/src/WixToolset.Core/LayoutContext.cs index deb5057f..4b8c7b99 100644 --- a/src/WixToolset.Core/LayoutContext.cs +++ b/src/WixToolset.Core/LayoutContext.cs | |||
@@ -17,13 +17,13 @@ namespace WixToolset.Core | |||
17 | 17 | ||
18 | public IServiceProvider ServiceProvider { get; } | 18 | public IServiceProvider ServiceProvider { get; } |
19 | 19 | ||
20 | public IEnumerable<ILayoutExtension> Extensions { get; set; } | 20 | public IReadOnlyCollection<ILayoutExtension> Extensions { get; set; } |
21 | 21 | ||
22 | public IEnumerable<IFileSystemExtension> FileSystemExtensions { get; set; } | 22 | public IReadOnlyCollection<IFileSystemExtension> FileSystemExtensions { get; set; } |
23 | 23 | ||
24 | public IEnumerable<IFileTransfer> FileTransfers { get; set; } | 24 | public IReadOnlyCollection<IFileTransfer> FileTransfers { get; set; } |
25 | 25 | ||
26 | public IEnumerable<ITrackedFile> TrackedFiles { get; set; } | 26 | public IReadOnlyCollection<ITrackedFile> TrackedFiles { get; set; } |
27 | 27 | ||
28 | public string IntermediateFolder { get; set; } | 28 | public string IntermediateFolder { get; set; } |
29 | 29 | ||
diff --git a/src/WixToolset.Core/LibraryContext.cs b/src/WixToolset.Core/LibraryContext.cs index 62d4e70c..e701cadf 100644 --- a/src/WixToolset.Core/LibraryContext.cs +++ b/src/WixToolset.Core/LibraryContext.cs | |||
@@ -23,15 +23,15 @@ namespace WixToolset.Core | |||
23 | 23 | ||
24 | public bool BindFiles { get; set; } | 24 | public bool BindFiles { get; set; } |
25 | 25 | ||
26 | public IEnumerable<IBindPath> BindPaths { get; set; } | 26 | public IReadOnlyCollection<IBindPath> BindPaths { get; set; } |
27 | 27 | ||
28 | public IEnumerable<ILibrarianExtension> Extensions { get; set; } | 28 | public IReadOnlyCollection<ILibrarianExtension> Extensions { get; set; } |
29 | 29 | ||
30 | public string LibraryId { get; set; } | 30 | public string LibraryId { get; set; } |
31 | 31 | ||
32 | public IEnumerable<Localization> Localizations { get; set; } | 32 | public IReadOnlyCollection<Localization> Localizations { get; set; } |
33 | 33 | ||
34 | public IEnumerable<Intermediate> Intermediates { get; set; } | 34 | public IReadOnlyCollection<Intermediate> Intermediates { get; set; } |
35 | 35 | ||
36 | public CancellationToken CancellationToken { get; set; } | 36 | public CancellationToken CancellationToken { get; set; } |
37 | } | 37 | } |
diff --git a/src/WixToolset.Core/LinkContext.cs b/src/WixToolset.Core/LinkContext.cs index 528d0f0f..b99bb9c4 100644 --- a/src/WixToolset.Core/LinkContext.cs +++ b/src/WixToolset.Core/LinkContext.cs | |||
@@ -8,7 +8,6 @@ namespace WixToolset.Core | |||
8 | using WixToolset.Data; | 8 | using WixToolset.Data; |
9 | using WixToolset.Extensibility; | 9 | using WixToolset.Extensibility; |
10 | using WixToolset.Extensibility.Data; | 10 | using WixToolset.Extensibility.Data; |
11 | using WixToolset.Extensibility.Services; | ||
12 | 11 | ||
13 | internal class LinkContext : ILinkContext | 12 | internal class LinkContext : ILinkContext |
14 | { | 13 | { |
@@ -19,13 +18,13 @@ namespace WixToolset.Core | |||
19 | 18 | ||
20 | public IServiceProvider ServiceProvider { get; } | 19 | public IServiceProvider ServiceProvider { get; } |
21 | 20 | ||
22 | public IEnumerable<ILinkerExtension> Extensions { get; set; } | 21 | public IReadOnlyCollection<ILinkerExtension> Extensions { get; set; } |
23 | 22 | ||
24 | public IEnumerable<IExtensionData> ExtensionData { get; set; } | 23 | public IReadOnlyCollection<IExtensionData> ExtensionData { get; set; } |
25 | 24 | ||
26 | public OutputType ExpectedOutputType { get; set; } | 25 | public OutputType ExpectedOutputType { get; set; } |
27 | 26 | ||
28 | public IEnumerable<Intermediate> Intermediates { get; set; } | 27 | public IReadOnlyCollection<Intermediate> Intermediates { get; set; } |
29 | 28 | ||
30 | public ISymbolDefinitionCreator SymbolDefinitionCreator { get; set; } | 29 | public ISymbolDefinitionCreator SymbolDefinitionCreator { get; set; } |
31 | 30 | ||
diff --git a/src/WixToolset.Core/PreprocessContext.cs b/src/WixToolset.Core/PreprocessContext.cs index 0b735a7c..986045ff 100644 --- a/src/WixToolset.Core/PreprocessContext.cs +++ b/src/WixToolset.Core/PreprocessContext.cs | |||
@@ -18,11 +18,11 @@ namespace WixToolset.Core | |||
18 | 18 | ||
19 | public IServiceProvider ServiceProvider { get; } | 19 | public IServiceProvider ServiceProvider { get; } |
20 | 20 | ||
21 | public IEnumerable<IPreprocessorExtension> Extensions { get; set; } | 21 | public IReadOnlyCollection<IPreprocessorExtension> Extensions { get; set; } |
22 | 22 | ||
23 | public Platform Platform { get; set; } | 23 | public Platform Platform { get; set; } |
24 | 24 | ||
25 | public IEnumerable<string> IncludeSearchPaths { get; set; } | 25 | public IReadOnlyCollection<string> IncludeSearchPaths { get; set; } |
26 | 26 | ||
27 | public string SourcePath { get; set; } | 27 | public string SourcePath { get; set; } |
28 | 28 | ||
diff --git a/src/WixToolset.Core/PreprocessResult.cs b/src/WixToolset.Core/PreprocessResult.cs index 7126f049..83b29a90 100644 --- a/src/WixToolset.Core/PreprocessResult.cs +++ b/src/WixToolset.Core/PreprocessResult.cs | |||
@@ -10,6 +10,6 @@ namespace WixToolset.Core | |||
10 | { | 10 | { |
11 | public XDocument Document { get; set; } | 11 | public XDocument Document { get; set; } |
12 | 12 | ||
13 | public IEnumerable<IIncludedFile> IncludedFiles { get; set; } | 13 | public IReadOnlyCollection<IIncludedFile> IncludedFiles { get; set; } |
14 | } | 14 | } |
15 | } | 15 | } |
diff --git a/src/WixToolset.Core/ResolveContext.cs b/src/WixToolset.Core/ResolveContext.cs index 185b556c..638c8079 100644 --- a/src/WixToolset.Core/ResolveContext.cs +++ b/src/WixToolset.Core/ResolveContext.cs | |||
@@ -19,19 +19,19 @@ namespace WixToolset.Core | |||
19 | 19 | ||
20 | public IServiceProvider ServiceProvider { get; } | 20 | public IServiceProvider ServiceProvider { get; } |
21 | 21 | ||
22 | public IEnumerable<IBindPath> BindPaths { get; set; } | 22 | public IReadOnlyCollection<IBindPath> BindPaths { get; set; } |
23 | 23 | ||
24 | public IEnumerable<IResolverExtension> Extensions { get; set; } | 24 | public IReadOnlyCollection<IResolverExtension> Extensions { get; set; } |
25 | 25 | ||
26 | public IEnumerable<IExtensionData> ExtensionData { get; set; } | 26 | public IReadOnlyCollection<IExtensionData> ExtensionData { get; set; } |
27 | 27 | ||
28 | public IEnumerable<string> FilterCultures { get; set; } | 28 | public IReadOnlyCollection<string> FilterCultures { get; set; } |
29 | 29 | ||
30 | public string IntermediateFolder { get; set; } | 30 | public string IntermediateFolder { get; set; } |
31 | 31 | ||
32 | public Intermediate IntermediateRepresentation { get; set; } | 32 | public Intermediate IntermediateRepresentation { get; set; } |
33 | 33 | ||
34 | public IEnumerable<Localization> Localizations { get; set; } | 34 | public IReadOnlyCollection<Localization> Localizations { get; set; } |
35 | 35 | ||
36 | public IVariableResolver VariableResolver { get; set; } | 36 | public IVariableResolver VariableResolver { get; set; } |
37 | 37 | ||
diff --git a/src/WixToolset.Core/ResolveFileResult.cs b/src/WixToolset.Core/ResolveFileResult.cs index 12b31d54..f6e201d4 100644 --- a/src/WixToolset.Core/ResolveFileResult.cs +++ b/src/WixToolset.Core/ResolveFileResult.cs | |||
@@ -9,6 +9,6 @@ namespace WixToolset.Core | |||
9 | { | 9 | { |
10 | public string Path { get; set; } | 10 | public string Path { get; set; } |
11 | 11 | ||
12 | public IEnumerable<string> CheckedPaths { get; set; } | 12 | public IReadOnlyCollection<string> CheckedPaths { get; set; } |
13 | } | 13 | } |
14 | } | 14 | } |
diff --git a/src/WixToolset.Core/ResolveResult.cs b/src/WixToolset.Core/ResolveResult.cs index 38b432b0..fa8e09b7 100644 --- a/src/WixToolset.Core/ResolveResult.cs +++ b/src/WixToolset.Core/ResolveResult.cs | |||
@@ -14,9 +14,9 @@ namespace WixToolset.Core | |||
14 | 14 | ||
15 | public int? PackageLcid { get; set; } | 15 | public int? PackageLcid { get; set; } |
16 | 16 | ||
17 | public IEnumerable<IDelayedField> DelayedFields { get; set; } | 17 | public IReadOnlyCollection<IDelayedField> DelayedFields { get; set; } |
18 | 18 | ||
19 | public IEnumerable<IExpectedExtractFile> ExpectedEmbeddedFiles { get; set; } | 19 | public IReadOnlyCollection<IExpectedExtractFile> ExpectedEmbeddedFiles { get; set; } |
20 | 20 | ||
21 | public Intermediate IntermediateRepresentation { get; set; } | 21 | public Intermediate IntermediateRepresentation { get; set; } |
22 | } | 22 | } |
diff --git a/src/WixToolset.Core/Resolver.cs b/src/WixToolset.Core/Resolver.cs index f4cb2fd6..e93f8e1b 100644 --- a/src/WixToolset.Core/Resolver.cs +++ b/src/WixToolset.Core/Resolver.cs | |||
@@ -77,7 +77,7 @@ namespace WixToolset.Core | |||
77 | 77 | ||
78 | var filesWithEmbeddedFiles = new ExtractEmbeddedFiles(); | 78 | var filesWithEmbeddedFiles = new ExtractEmbeddedFiles(); |
79 | 79 | ||
80 | IEnumerable<DelayedField> delayedFields; | 80 | IReadOnlyCollection<DelayedField> delayedFields; |
81 | { | 81 | { |
82 | var command = new ResolveFieldsCommand(); | 82 | var command = new ResolveFieldsCommand(); |
83 | command.Messaging = this.Messaging; | 83 | command.Messaging = this.Messaging; |
diff --git a/src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs b/src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs index 49f68de5..7244798a 100644 --- a/src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs +++ b/src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs | |||
@@ -12,7 +12,7 @@ namespace Example.Extension | |||
12 | { | 12 | { |
13 | private string exampleValueFromCommandLine; | 13 | private string exampleValueFromCommandLine; |
14 | 14 | ||
15 | public IEnumerable<ExtensionCommandLineSwitch> CommandLineSwitches => throw new NotImplementedException(); | 15 | public IReadOnlyCollection<ExtensionCommandLineSwitch> CommandLineSwitches => throw new NotImplementedException(); |
16 | 16 | ||
17 | public ExamplePreprocessorExtensionAndCommandLine() | 17 | public ExamplePreprocessorExtensionAndCommandLine() |
18 | { | 18 | { |
diff --git a/src/test/Example.Extension/ExampleWindowsInstallerBackendExtension.cs b/src/test/Example.Extension/ExampleWindowsInstallerBackendExtension.cs index 87b7855c..afccc56f 100644 --- a/src/test/Example.Extension/ExampleWindowsInstallerBackendExtension.cs +++ b/src/test/Example.Extension/ExampleWindowsInstallerBackendExtension.cs | |||
@@ -9,7 +9,7 @@ namespace Example.Extension | |||
9 | 9 | ||
10 | internal class ExampleWindowsInstallerBackendExtension : BaseWindowsInstallerBackendBinderExtension | 10 | internal class ExampleWindowsInstallerBackendExtension : BaseWindowsInstallerBackendBinderExtension |
11 | { | 11 | { |
12 | public override IEnumerable<TableDefinition> TableDefinitions => ExampleTableDefinitions.All; | 12 | public override IReadOnlyCollection<TableDefinition> TableDefinitions => ExampleTableDefinitions.All; |
13 | 13 | ||
14 | public override bool TryProcessSymbol(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData output, TableDefinitionCollection tableDefinitions) | 14 | public override bool TryProcessSymbol(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData output, TableDefinitionCollection tableDefinitions) |
15 | { | 15 | { |
diff --git a/src/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs b/src/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs index 676d7d87..cfe4d3f1 100644 --- a/src/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | namespace WixToolsetTest.CoreIntegration | 4 | namespace WixToolsetTest.CoreIntegration |
5 | { | 5 | { |
6 | using System; | ||
6 | using System.IO; | 7 | using System.IO; |
7 | using System.Linq; | 8 | using System.Linq; |
8 | using WixBuildTools.TestSupport; | 9 | using WixBuildTools.TestSupport; |
@@ -29,8 +30,8 @@ namespace WixToolsetTest.CoreIntegration | |||
29 | 30 | ||
30 | var creator = serviceProvider.GetService<ISymbolDefinitionCreator>(); | 31 | var creator = serviceProvider.GetService<ISymbolDefinitionCreator>(); |
31 | var context = serviceProvider.GetService<ILinkContext>(); | 32 | var context = serviceProvider.GetService<ILinkContext>(); |
32 | context.Extensions = Enumerable.Empty<WixToolset.Extensibility.ILinkerExtension>(); | 33 | context.Extensions = Array.Empty<WixToolset.Extensibility.ILinkerExtension>(); |
33 | context.ExtensionData = Enumerable.Empty<WixToolset.Extensibility.IExtensionData>(); | 34 | context.ExtensionData = Array.Empty<WixToolset.Extensibility.IExtensionData>(); |
34 | context.Intermediates = new[] { intermediate1, intermediate2 }; | 35 | context.Intermediates = new[] { intermediate1, intermediate2 }; |
35 | context.SymbolDefinitionCreator = creator; | 36 | context.SymbolDefinitionCreator = creator; |
36 | 37 | ||