| 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 | } |