diff options
Diffstat (limited to 'src/dtf/test/WixToolsetTests.Dtf.Compression/OptionStreamContext.cs')
-rw-r--r-- | src/dtf/test/WixToolsetTests.Dtf.Compression/OptionStreamContext.cs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/dtf/test/WixToolsetTests.Dtf.Compression/OptionStreamContext.cs b/src/dtf/test/WixToolsetTests.Dtf.Compression/OptionStreamContext.cs new file mode 100644 index 00000000..98354d97 --- /dev/null +++ b/src/dtf/test/WixToolsetTests.Dtf.Compression/OptionStreamContext.cs | |||
@@ -0,0 +1,42 @@ | |||
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 | using System; | ||
4 | using System.Collections.Generic; | ||
5 | using WixToolset.Dtf.Compression; | ||
6 | |||
7 | namespace WixToolset.Dtf.Test | ||
8 | { | ||
9 | public class OptionStreamContext : ArchiveFileStreamContext | ||
10 | { | ||
11 | private PackOptionHandler packOptionHandler; | ||
12 | |||
13 | public OptionStreamContext(IList<string> archiveFiles, string directory, IDictionary<string, string> files) | ||
14 | : base(archiveFiles, directory, files) | ||
15 | { | ||
16 | } | ||
17 | |||
18 | public delegate object PackOptionHandler(string optionName, object[] parameters); | ||
19 | |||
20 | public PackOptionHandler OptionHandler | ||
21 | { | ||
22 | get | ||
23 | { | ||
24 | return this.packOptionHandler; | ||
25 | } | ||
26 | set | ||
27 | { | ||
28 | this.packOptionHandler = value; | ||
29 | } | ||
30 | } | ||
31 | |||
32 | public override object GetOption(string optionName, object[] parameters) | ||
33 | { | ||
34 | if (this.OptionHandler == null) | ||
35 | { | ||
36 | return null; | ||
37 | } | ||
38 | |||
39 | return this.OptionHandler(optionName, parameters); | ||
40 | } | ||
41 | } | ||
42 | } | ||