Incorporate refactoring of WixToolset.Core assemblies
Rob Mensching committed
Oct 18, 2017 at 15:21 UTC
7efd412cda00b369bc331c9bedd8db971d98fee7
27 files changed
+427
-188
src/WixToolset.Extensibility/AssemblyInfo.cs
+1
-1
@@ -5,5 +5,5 @@ using System.Reflection;
5
using System.Runtime.InteropServices;
6
7
[assembly: AssemblyCulture("")]
8
-[assembly:CLSCompliant(true)]
8
+[assembly: CLSCompliant(true)]
9
[assembly: ComVisible(false)]
src/WixToolset.Extensibility/BindPath.cs
deleted
-52
@@ -1,52 +0,0 @@
1
-// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
-
3
-namespace WixToolset.Extensibility
4
-{
5
- using System;
6
-
7
- /// <summary>
8
- /// Bind path representation.
9
- /// </summary>
10
- public class BindPath
11
- {
12
- /// <summary>
13
- /// Creates an unnamed bind path.
14
- /// </summary>
15
- /// <param name="path">Path for the bind path.</param>
16
- public BindPath(string path) : this(String.Empty, path)
17
- {
18
- }
19
-
20
- /// <summary>
21
- /// Creates a named bind path.
22
- /// </summary>
23
- /// <param name="name">Name of the bind path.</param>
24
- /// <param name="path">Path for the bind path.</param>
25
- public BindPath(string name, string path)
26
- {
27
- this.Name = name;
28
- this.Path = path;
29
- }
30
-
31
- /// <summary>
32
- /// Parses a bind path from its string representation
33
- /// </summary>
34
- /// <param name="bindPath">String representation of bind path that looks like: [name=]path</param>
35
- /// <returns>Parsed bind path.</returns>
36
- public static BindPath Parse(string bindPath)
37
- {
38
- string[] namedPath = bindPath.Split(new char[] { '=' }, 2);
39
- return (1 == namedPath.Length) ? new BindPath(namedPath[0]) : new BindPath(namedPath[0], namedPath[1]);
40
- }
41
-
42
- /// <summary>
43
- /// Name of the bind path or String.Empty if the path is unnamed.
44
- /// </summary>
45
- public string Name { get; set; }
46
-
47
- /// <summary>
48
- /// Path for the bind path.
49
- /// </summary>
50
- public string Path { get; set; }
51
- }
52
-}
src/WixToolset.Extensibility/BindStage.cs
deleted
-27
@@ -1,27 +0,0 @@
1
-// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
-
3
-namespace WixToolset.Extensibility
4
-{
5
- /// <summary>
6
- /// Bind stage of a file.. The reason we need this is to change the ResolveFile behavior based on if
7
- /// dynamic bindpath plugin is desirable. We cannot change the signature of ResolveFile since it might
8
- /// break existing implementers which derived from BinderFileManager
9
- /// </summary>
10
- public enum BindStage
11
- {
12
- /// <summary>
13
- /// Normal binding
14
- /// </summary>
15
- Normal,
16
-
17
- /// <summary>
18
- /// Bind the file path of the target build file
19
- /// </summary>
20
- Target,
21
-
22
- /// <summary>
23
- /// Bind the file path of the updated build file
24
- /// </summary>
25
- Updated,
26
- }
27
-}
src/WixToolset.Extensibility/BinderExtension.cs
deleted
-40
@@ -1,40 +0,0 @@
1
-// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
-
3
-namespace WixToolset.Extensibility
4
-{
5
- using WixToolset.Data;
6
-
7
- /// <summary>
8
- /// Base class for creating an binder extension.
9
- /// </summary>
10
- public abstract class BinderExtension : IBinderExtension
11
- {
12
- /// <summary>
13
- /// Gets or sets the binder core for the extension.
14
- /// </summary>
15
- /// <value>Binder core for the extension.</value>
16
- public IBinderCore Core { get; set; }
17
-
18
-
19
- /// <summary>
20
- /// Called before binding occurs.
21
- /// </summary>
22
- public virtual void Initialize(Output output)
23
- {
24
- }
25
-
26
- /// <summary>
27
- /// Called after variable resolution occurs.
28
- /// </summary>
29
- public virtual void AfterResolvedFields(Output output)
30
- {
31
- }
32
-
33
- /// <summary>
34
- /// Called after all output changes occur and right before the output is bound into its final format.
35
- /// </summary>
36
- public virtual void Finish(Output output)
37
- {
38
- }
39
- }
40
-}
src/WixToolset.Extensibility/BinderExtensionBase.cs
new
+55
@@ -0,0 +1,55 @@
1
+// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+
3
+namespace WixToolset.Extensibility
4
+{
5
+ using WixToolset.Data;
6
+ using WixToolset.Data.Bind;
7
+ using WixToolset.Extensibility.Services;
8
+
9
+ public abstract class BinderExtensionBase : IBinderExtension
10
+ {
11
+ protected IBindContext Context { get; private set; }
12
+
13
+ /// <summary>
14
+ /// Called before binding occurs.
15
+ /// </summary>
16
+ public virtual void PreBind(IBindContext context)
17
+ {
18
+ this.Context = context;
19
+ }
20
+
21
+ /// <summary>
22
+ /// Called after variable resolution occurs.
23
+ /// </summary>
24
+ public virtual void AfterResolvedFields(Output output)
25
+ {
26
+ }
27
+
28
+ public virtual string ResolveFile(string source, string type, SourceLineNumber sourceLineNumbers, BindStage bindStage)
29
+ {
30
+ return null;
31
+ }
32
+
33
+ public virtual bool? CompareFiles(string targetFile, string updatedFile)
34
+ {
35
+ return null;
36
+ }
37
+
38
+ public virtual bool CopyFile(string source, string destination, bool overwrite)
39
+ {
40
+ return false;
41
+ }
42
+
43
+ public virtual bool MoveFile(string source, string destination, bool overwrite)
44
+ {
45
+ return false;
46
+ }
47
+
48
+ /// <summary>
49
+ /// Called after binding is complete before the files are moved to their final locations.
50
+ /// </summary>
51
+ public virtual void PostBind(BindResult result)
52
+ {
53
+ }
54
+ }
55
+}
src/WixToolset.Extensibility/IBackend.cs
new
+17
@@ -0,0 +1,17 @@
1
+// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+
3
+namespace WixToolset.Extensibility
4
+{
5
+ using WixToolset.Data;
6
+ using WixToolset.Data.Bind;
7
+ using WixToolset.Extensibility.Services;
8
+
9
+ public interface IBackend
10
+ {
11
+ BindResult Bind(IBindContext context);
12
+
13
+ Output Unbind(IUnbindContext context);
14
+
15
+ bool Inscribe(IInscribeContext context);
16
+ }
17
+}
src/WixToolset.Extensibility/IBackendFactory.cs
new
+11
@@ -0,0 +1,11 @@
1
+// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+
3
+namespace WixToolset.Extensibility
4
+{
5
+ using WixToolset.Extensibility.Services;
6
+
7
+ public interface IBackendFactory
8
+ {
9
+ bool TryCreateBackend(string outputType, string outputPath, IBindContext context, out IBackend backend);
10
+ }
11
+}
src/WixToolset.Extensibility/IBindVariableResolver.cs
new
+26
@@ -0,0 +1,26 @@
1
+// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+
3
+namespace WixToolset.Extensibility
4
+{
5
+ using WixToolset.Data;
6
+ using WixToolset.Data.Rows;
7
+
8
+ public interface IBindVariableResolver
9
+ {
10
+ int VariableCount { get; }
11
+
12
+ void AddVariable(string name, string value);
13
+
14
+ void AddVariable(WixVariableRow wixVariableRow);
15
+
16
+ string ResolveVariables(SourceLineNumber sourceLineNumbers, string value, bool localizationOnly);
17
+
18
+ string ResolveVariables(SourceLineNumber sourceLineNumbers, string value, bool localizationOnly, bool errorOnUnknown, out bool isDefault, out bool delayedResolve);
19
+
20
+ string ResolveVariables(SourceLineNumber sourceLineNumbers, string value, bool localizationOnly, out bool isDefault);
21
+
22
+ string ResolveVariables(SourceLineNumber sourceLineNumbers, string value, bool localizationOnly, out bool isDefault, out bool delayedResolve);
23
+
24
+ bool TryGetLocalizedControl(string dialog, string control, out LocalizedControl localizedControl);
25
+ }
26
+}
src/WixToolset.Extensibility/IBinderExtension.cs
+12
-8
@@ -3,31 +3,35 @@
3
namespace WixToolset.Extensibility
4
{
5
using WixToolset.Data;
6
+ using WixToolset.Data.Bind;
7
+ using WixToolset.Extensibility.Services;
8
9
/// <summary>
10
/// Interface all binder extensions implement.
11
/// </summary>
12
public interface IBinderExtension
13
{
12
- /// <summary>
13
- /// Gets or sets the binder core for the extension.
14
- /// </summary>
15
- /// <value>Binder core for the extension.</value>
16
- IBinderCore Core { get; set; }
17
-
14
/// <summary>
15
/// Called before binding occurs.
16
/// </summary>
21
- void Initialize(Output output);
17
+ void PreBind(IBindContext context);
18
19
/// <summary>
20
/// Called after variable resolution occurs.
21
/// </summary>
22
void AfterResolvedFields(Output output);
23
24
+ string ResolveFile(string source, string type, SourceLineNumber sourceLineNumbers, BindStage bindStage);
25
+
26
+ bool? CompareFiles(string targetFile, string updatedFile);
27
+
28
+ bool CopyFile(string source, string destination, bool overwrite);
29
+
30
+ bool MoveFile(string source, string destination, bool overwrite);
31
+
32
/// <summary>
33
/// Called after all output changes occur and right before the output is bound into its final format.
34
/// </summary>
31
- void Finish(Output output);
35
+ void PostBind(BindResult result);
36
}
37
}
src/WixToolset.Extensibility/IBinderFileManager.cs
deleted
-29
@@ -1,29 +0,0 @@
1
-// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
-
3
-namespace WixToolset.Extensibility
4
-{
5
- using System.Collections.Generic;
6
- using WixToolset.Data;
7
- using WixToolset.Data.Rows;
8
-
9
- public interface IBinderFileManager
10
- {
11
- IBinderFileManagerCore Core { set; }
12
-
13
- ResolvedCabinet ResolveCabinet(string cabinetPath, IEnumerable<BindFileWithPath> files);
14
-
15
- string ResolveFile(string source, string type, SourceLineNumber sourceLineNumbers, BindStage bindStage);
16
-
17
- string ResolveRelatedFile(string source, string relatedSource, string type, SourceLineNumber sourceLineNumbers, BindStage bindStage);
18
-
19
- string ResolveMedia(MediaRow mediaRow, string mediaLayoutDirectory, string layoutDirectory);
20
-
21
- string ResolveUrl(string url, string fallbackUrl, string packageId, string payloadId, string fileName);
22
-
23
- bool? CompareFiles(string targetFile, string updatedFile);
24
-
25
- bool CopyFile(string source, string destination, bool overwrite);
26
-
27
- bool MoveFile(string source, string destination, bool overwrite);
28
- }
29
-}
src/WixToolset.Extensibility/IBinderFileManagerCore.cs
+1
@@ -4,6 +4,7 @@ namespace WixToolset.Extensibility
4
{
5
using System.Collections.Generic;
6
using WixToolset.Data;
7
+ using WixToolset.Data.Bind;
8
9
public interface IBinderFileManagerCore : IMessageHandler
10
{
src/WixToolset.Extensibility/IBurnBackendExtension.cs
new
+25
@@ -0,0 +1,25 @@
1
+// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+
3
+namespace WixToolset.Extensibility
4
+{
5
+ using WixToolset.Data;
6
+ using WixToolset.Data.Bind;
7
+ using WixToolset.Extensibility.Services;
8
+
9
+ public interface IBurnBackendExtension
10
+ {
11
+ /// <summary>
12
+ /// Called before binding occurs.
13
+ /// </summary>
14
+ void PreBackendBind(IBindContext context);
15
+
16
+ string ResolveRelatedFile(string source, string relatedSource, string type, SourceLineNumber sourceLineNumbers, BindStage bindStage);
17
+
18
+ string ResolveUrl(string url, string fallbackUrl, string packageId, string payloadId, string fileName);
19
+
20
+ /// <summary>
21
+ /// Called after all output changes occur and right before the output is bound into its final format.
22
+ /// </summary>
23
+ void PostBackendBind(BindResult result);
24
+ }
25
+}
src/WixToolset.Extensibility/IDelayedField.cs
new
+13
@@ -0,0 +1,13 @@
1
+// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+
3
+namespace WixToolset.Extensibility
4
+{
5
+ using WixToolset.Data;
6
+
7
+ public interface IDelayedField
8
+ {
9
+ Field Field { get; }
10
+
11
+ Row Row { get; }
12
+ }
13
+}
\ No newline at end of file
src/WixToolset.Extensibility/IExpectedExtractFile.cs
new
+15
@@ -0,0 +1,15 @@
1
+// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+
3
+namespace WixToolset.Extensibility
4
+{
5
+ using System;
6
+
7
+ public interface IExpectedExtractFile
8
+ {
9
+ Uri Uri { get; set; }
10
+
11
+ int EmbeddedFileIndex { get; set; }
12
+
13
+ string OutputPath { get; set; }
14
+ }
15
+}
\ No newline at end of file
src/WixToolset.Extensibility/IInscribeContext.cs
new
+22
@@ -0,0 +1,22 @@
1
+// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+
3
+namespace WixToolset.Extensibility
4
+{
5
+ using System;
6
+ using WixToolset.Data;
7
+
8
+ public interface IInscribeContext
9
+ {
10
+ IServiceProvider ServiceProvider { get; }
11
+
12
+ string InputFilePath { get; set; }
13
+
14
+ string IntermediateFolder { get; set; }
15
+
16
+ Messaging Messaging { get; }
17
+
18
+ string OutputFile { get; set; }
19
+
20
+ string SignedEngineFile { get; set; }
21
+ }
22
+}
src/WixToolset.Extensibility/ILibrarianExtension.cs
new
+15
@@ -0,0 +1,15 @@
1
+// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+
3
+namespace WixToolset.Extensibility
4
+{
5
+ using WixToolset.Data;
6
+
7
+ public interface ILibrarianExtension
8
+ {
9
+ void PreCombine(ILibraryContext context);
10
+
11
+ string Resolve(SourceLineNumber sourceLineNumber, string table, string path);
12
+
13
+ void PostCombine(Library library);
14
+ }
15
+}
src/WixToolset.Extensibility/ILibraryContext.cs
new
+20
@@ -0,0 +1,20 @@
1
+// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+
3
+namespace WixToolset.Extensibility
4
+{
5
+ using System.Collections.Generic;
6
+ using WixToolset.Data;
7
+
8
+ public interface ILibraryContext
9
+ {
10
+ bool BindFiles { get; set; }
11
+
12
+ IEnumerable<ILibrarianExtension> Extensions { get; set; }
13
+
14
+ IEnumerable<Localization> Localizations { get; set; }
15
+
16
+ IEnumerable<Section> Sections { get; set; }
17
+
18
+ IBindVariableResolver WixVariableResolver { get; set; }
19
+ }
20
+}
src/WixToolset.Extensibility/ILocalizer.cs
new
+15
@@ -0,0 +1,15 @@
1
+// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+
3
+namespace WixToolset.Extensibility
4
+{
5
+ using WixToolset.Data;
6
+
7
+ public interface ILocalizer
8
+ {
9
+ int Codepage { get; }
10
+
11
+ string GetLocalizedValue(string id);
12
+
13
+ LocalizedControl GetLocalizedControl(string dialog, string control);
14
+ }
15
+}
src/WixToolset.Extensibility/IUnbindContext.cs
new
+23
@@ -0,0 +1,23 @@
1
+// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+
3
+namespace WixToolset.Extensibility
4
+{
5
+ using WixToolset.Data;
6
+
7
+ public interface IUnbindContext
8
+ {
9
+ string ExportBasePath { get; set; }
10
+
11
+ string InputFilePath { get; set; }
12
+
13
+ string IntermediateFolder { get; set; }
14
+
15
+ bool IsAdminImage { get; set; }
16
+
17
+ Messaging Messaging { get; }
18
+
19
+ bool SuppressDemodularization { get; set; }
20
+
21
+ bool SuppressExtractCabinets { get; set; }
22
+ }
23
+}
\ No newline at end of file
src/WixToolset.Extensibility/IWindowsInstallerBackendExtension.cs
new
+29
@@ -0,0 +1,29 @@
1
+// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+
3
+namespace WixToolset.Extensibility
4
+{
5
+ using System.Collections.Generic;
6
+ using WixToolset.Data.Rows;
7
+ using WixToolset.Data.Bind;
8
+ using WixToolset.Extensibility.Services;
9
+
10
+ /// <summary>
11
+ /// Interface all binder extensions implement.
12
+ /// </summary>
13
+ public interface IWindowsInstallerBackendExtension
14
+ {
15
+ /// <summary>
16
+ /// Called before binding occurs.
17
+ /// </summary>
18
+ void PreBackendBind(IBindContext context);
19
+
20
+ ResolvedCabinet ResolveCabinet(string cabinetPath, IEnumerable<BindFileWithPath> files);
21
+
22
+ string ResolveMedia(MediaRow mediaRow, string mediaLayoutDirectory, string layoutDirectory);
23
+
24
+ /// <summary>
25
+ /// Called after all output changes occur and right before the output is bound into its final format.
26
+ /// </summary>
27
+ void PostBackendBind(BindResult result);
28
+ }
29
+}
src/WixToolset.Extensibility/Identifier.cs
deleted
-31
@@ -1,31 +0,0 @@
1
-// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
-
3
-namespace WixToolset.Extensibility
4
-{
5
- using System;
6
- using WixToolset.Data;
7
-
8
- /// <summary>
9
- /// Class to define the identifier and access for a row.
10
- /// </summary>
11
- public class Identifier
12
- {
13
- public static Identifier Invalid = new Identifier(null, AccessModifier.Private);
14
-
15
- public Identifier(string id, AccessModifier access)
16
- {
17
- this.Id = id;
18
- this.Access = access;
19
- }
20
-
21
- /// <summary>
22
- /// Access modifier for a row.
23
- /// </summary>
24
- public AccessModifier Access { get; private set; }
25
-
26
- /// <summary>
27
- /// Identifier for the row.
28
- /// </summary>
29
- public string Id { get; private set; }
30
- }
31
-}
src/WixToolset.Extensibility/Services/IBindContext.cs
new
+59
@@ -0,0 +1,59 @@
1
+// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+
3
+namespace WixToolset.Extensibility.Services
4
+{
5
+ using System;
6
+ using System.Collections.Generic;
7
+ using WixToolset.Data;
8
+
9
+ public interface IBindContext
10
+ {
11
+ IServiceProvider ServiceProvider { get; }
12
+
13
+ Messaging Messaging { get; set; }
14
+
15
+ IEnumerable<BindPath> BindPaths { get; set; }
16
+
17
+ int CabbingThreadCount { get; set; }
18
+
19
+ string CabCachePath { get; set; }
20
+
21
+ int Codepage { get; set; }
22
+
23
+ CompressionLevel DefaultCompressionLevel { get; set; }
24
+
25
+ IEnumerable<IDelayedField> DelayedFields { get; set; }
26
+
27
+ IEnumerable<IExpectedExtractFile> ExpectedEmbeddedFiles { get; set; }
28
+
29
+ IExtensionManager ExtensionManager { get; set; }
30
+
31
+ IEnumerable<IBinderExtension> Extensions { get; set; }
32
+
33
+ IEnumerable<string> Ices { get; set; }
34
+
35
+ string IntermediateFolder { get; set; }
36
+
37
+ Output IntermediateRepresentation { get; set; }
38
+
39
+ string OutputPath { get; set; }
40
+
41
+ string OutputPdbPath { get; set; }
42
+
43
+ bool SuppressAclReset { get; set; }
44
+
45
+ IEnumerable<string> SuppressIces { get; set; }
46
+
47
+ bool SuppressValidation { get; set; }
48
+
49
+ IBindVariableResolver WixVariableResolver { get; set; }
50
+
51
+ string ContentsFile { get; set; }
52
+
53
+ string OutputsFile { get; set; }
54
+
55
+ string BuiltOutputsFile { get; set; }
56
+
57
+ string WixprojectFile { get; set; }
58
+ }
59
+}
src/WixToolset.Extensibility/Services/ICommandLine.cs
new
+9
@@ -0,0 +1,9 @@
1
+// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+
3
+namespace WixToolset.Extensibility.Services
4
+{
5
+ public interface ICommandLine
6
+ {
7
+ ICommandLineCommand ParseStandardCommandLine(ICommandLineContext commandLineContext);
8
+ }
9
+}
src/WixToolset.Extensibility/Services/ICommandLineCommand.cs
new
+9
@@ -0,0 +1,9 @@
1
+// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+
3
+namespace WixToolset.Extensibility.Services
4
+{
5
+ public interface ICommandLineCommand
6
+ {
7
+ int Execute();
8
+ }
9
+}
src/WixToolset.Extensibility/Services/ICommandLineContext.cs
new
+20
@@ -0,0 +1,20 @@
1
+// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+
3
+namespace WixToolset.Extensibility.Services
4
+{
5
+ using System;
6
+ using WixToolset.Data;
7
+
8
+ public interface ICommandLineContext
9
+ {
10
+ IServiceProvider ServiceProvider { get; }
11
+
12
+ Messaging Messaging { get; set; }
13
+
14
+ IExtensionManager ExtensionManager { get; set; }
15
+
16
+ string Arguments { get; set; }
17
+
18
+ string[] ParsedArguments { get; set; }
19
+ }
20
+}
src/WixToolset.Extensibility/Services/IExtensionManager.cs
new
+16
@@ -0,0 +1,16 @@
1
+// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+
3
+namespace WixToolset.Extensibility.Services
4
+{
5
+ using System.Collections.Generic;
6
+ using System.Reflection;
7
+
8
+ public interface IExtensionManager
9
+ {
10
+ Assembly Add(Assembly assembly);
11
+
12
+ Assembly Load(string extension);
13
+
14
+ IEnumerable<T> Create<T>() where T : class;
15
+ }
16
+}
src/WixToolset.Extensibility/Services/ServiceProviderExtensions.cs
new
+14
@@ -0,0 +1,14 @@
1
+// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
+
3
+namespace WixToolset.Extensibility.Services
4
+{
5
+ using System;
6
+
7
+ public static class ServiceProviderExtensions
8
+ {
9
+ public static T GetService<T>(this IServiceProvider serviceProvider) where T : class
10
+ {
11
+ return (T)serviceProvider.GetService(typeof(T));
12
+ }
13
+ }
14
+}