summaryrefslogtreecommitdiff
path: root/src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs')
-rw-r--r--src/test/Example.Extension/ExamplePreprocessorExtensionAndCommandLine.cs57
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
3namespace 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}