diff options
author | Rob Mensching <rob@firegiant.com> | 2021-04-22 17:19:56 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2021-04-29 19:53:52 -0700 |
commit | 8cf0427984a88b0b3ddfb2061e5be721afffe82e (patch) | |
tree | 22e2aaf7665d5ab6d3dc2a8ce8f05d73080d1f20 /src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs | |
parent | 8426095723fb8530a321260473ab543151bf8c98 (diff) | |
download | wix-8cf0427984a88b0b3ddfb2061e5be721afffe82e.tar.gz wix-8cf0427984a88b0b3ddfb2061e5be721afffe82e.tar.bz2 wix-8cf0427984a88b0b3ddfb2061e5be721afffe82e.zip |
Move Core into wix
Diffstat (limited to 'src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs')
-rw-r--r-- | src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs b/src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs deleted file mode 100644 index 7244798a..00000000 --- a/src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs +++ /dev/null | |||
@@ -1,57 +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 Example.Extension | ||
4 | { | ||
5 | using System; | ||
6 | using System.Collections.Generic; | ||
7 | using WixToolset.Extensibility; | ||
8 | using WixToolset.Extensibility.Data; | ||
9 | using WixToolset.Extensibility.Services; | ||
10 | |||
11 | internal class ExamplePreprocessorExtensionAndCommandLine : BasePreprocessorExtension, IExtensionCommandLine | ||
12 | { | ||
13 | private string exampleValueFromCommandLine; | ||
14 | |||
15 | public IReadOnlyCollection<ExtensionCommandLineSwitch> CommandLineSwitches => throw new NotImplementedException(); | ||
16 | |||
17 | public ExamplePreprocessorExtensionAndCommandLine() | ||
18 | { | ||
19 | this.Prefixes = new[] { "ex" }; | ||
20 | } | ||
21 | |||
22 | public void PreParse(ICommandLineContext context) | ||
23 | { | ||
24 | } | ||
25 | |||
26 | public bool TryParseArgument(ICommandLineParser parser, string argument) | ||
27 | { | ||
28 | if (parser.IsSwitch(argument) && argument.Substring(1).Equals("example", StringComparison.OrdinalIgnoreCase)) | ||
29 | { | ||
30 | this.exampleValueFromCommandLine = parser.GetNextArgumentOrError(argument); | ||
31 | return true; | ||
32 | } | ||
33 | |||
34 | return false; | ||
35 | } | ||
36 | |||
37 | public bool TryParseCommand(ICommandLineParser parser, string argument, out ICommandLineCommand command) | ||
38 | { | ||
39 | command = null; | ||
40 | return false; | ||
41 | } | ||
42 | |||
43 | public void PostParse() | ||
44 | { | ||
45 | } | ||
46 | |||
47 | public override string GetVariableValue(string prefix, string name) | ||
48 | { | ||
49 | if (prefix == "ex" && "test".Equals(name, StringComparison.OrdinalIgnoreCase)) | ||
50 | { | ||
51 | return String.IsNullOrWhiteSpace(this.exampleValueFromCommandLine) ? "(null)" : this.exampleValueFromCommandLine; | ||
52 | } | ||
53 | |||
54 | return null; | ||
55 | } | ||
56 | } | ||
57 | } | ||