diff options
Diffstat (limited to 'src/WixToolset.Core.Burn/Bind/WixSearchInfo.cs')
-rw-r--r-- | src/WixToolset.Core.Burn/Bind/WixSearchInfo.cs | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/WixToolset.Core.Burn/Bind/WixSearchInfo.cs b/src/WixToolset.Core.Burn/Bind/WixSearchInfo.cs new file mode 100644 index 00000000..9ebca4ae --- /dev/null +++ b/src/WixToolset.Core.Burn/Bind/WixSearchInfo.cs | |||
@@ -0,0 +1,53 @@ | |||
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.Core.Burn | ||
4 | { | ||
5 | using System; | ||
6 | using System.Diagnostics; | ||
7 | using System.Xml; | ||
8 | using WixToolset.Data; | ||
9 | |||
10 | /// <summary> | ||
11 | /// Utility base class for all WixSearches. | ||
12 | /// </summary> | ||
13 | internal abstract class WixSearchInfo | ||
14 | { | ||
15 | public WixSearchInfo(string id) | ||
16 | { | ||
17 | this.Id = id; | ||
18 | } | ||
19 | |||
20 | public void AddWixSearchRowInfo(Row row) | ||
21 | { | ||
22 | Debug.Assert((string)row[0] == Id); | ||
23 | Variable = (string)row[1]; | ||
24 | Condition = (string)row[2]; | ||
25 | } | ||
26 | |||
27 | public string Id { get; private set; } | ||
28 | public string Variable { get; private set; } | ||
29 | public string Condition { get; private set; } | ||
30 | |||
31 | /// <summary> | ||
32 | /// Generates Burn manifest and ParameterInfo-style markup a search. | ||
33 | /// </summary> | ||
34 | /// <param name="writer"></param> | ||
35 | public virtual void WriteXml(XmlTextWriter writer) | ||
36 | { | ||
37 | } | ||
38 | |||
39 | /// <summary> | ||
40 | /// Writes attributes common to all WixSearch elements. | ||
41 | /// </summary> | ||
42 | /// <param name="writer"></param> | ||
43 | protected void WriteWixSearchAttributes(XmlTextWriter writer) | ||
44 | { | ||
45 | writer.WriteAttributeString("Id", this.Id); | ||
46 | writer.WriteAttributeString("Variable", this.Variable); | ||
47 | if (!String.IsNullOrEmpty(this.Condition)) | ||
48 | { | ||
49 | writer.WriteAttributeString("Condition", this.Condition); | ||
50 | } | ||
51 | } | ||
52 | } | ||
53 | } | ||