diff options
Diffstat (limited to 'src/WixToolset.Data.WindowsInstaller/Rows/WixMergeRow.cs')
-rw-r--r-- | src/WixToolset.Data.WindowsInstaller/Rows/WixMergeRow.cs | 149 |
1 files changed, 149 insertions, 0 deletions
diff --git a/src/WixToolset.Data.WindowsInstaller/Rows/WixMergeRow.cs b/src/WixToolset.Data.WindowsInstaller/Rows/WixMergeRow.cs new file mode 100644 index 00000000..54f2125c --- /dev/null +++ b/src/WixToolset.Data.WindowsInstaller/Rows/WixMergeRow.cs | |||
@@ -0,0 +1,149 @@ | |||
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.Data.Rows | ||
4 | { | ||
5 | using System; | ||
6 | using System.Globalization; | ||
7 | using System.Text; | ||
8 | using System.Xml; | ||
9 | |||
10 | /// <summary> | ||
11 | /// Specialization of a row for tracking merge statements. | ||
12 | /// </summary> | ||
13 | public sealed class WixMergeRow : Row | ||
14 | { | ||
15 | /// <summary> | ||
16 | /// Creates a Merge row that does not belong to a table. | ||
17 | /// </summary> | ||
18 | /// <param name="sourceLineNumbers">Original source lines for this row.</param> | ||
19 | /// <param name="tableDef">TableDefinition this Merge row belongs to and should get its column definitions from.</param> | ||
20 | public WixMergeRow(SourceLineNumber sourceLineNumbers, TableDefinition tableDef) : | ||
21 | base(sourceLineNumbers, tableDef) | ||
22 | { | ||
23 | } | ||
24 | |||
25 | /// <summary>Creates a Merge row that belongs to a table.</summary> | ||
26 | /// <param name="sourceLineNumbers">Original source lines for this row.</param> | ||
27 | /// <param name="table">Table this Merge row belongs to and should get its column definitions from.</param> | ||
28 | public WixMergeRow(SourceLineNumber sourceLineNumbers, Table table) : | ||
29 | base(sourceLineNumbers, table) | ||
30 | { | ||
31 | } | ||
32 | |||
33 | /// <summary> | ||
34 | /// Gets and sets the id for a merge row. | ||
35 | /// </summary> | ||
36 | /// <value>Id for the row.</value> | ||
37 | public string Id | ||
38 | { | ||
39 | get { return (string)this.Fields[0].Data; } | ||
40 | set { this.Fields[0].Data = value; } | ||
41 | } | ||
42 | |||
43 | /// <summary> | ||
44 | /// Gets and sets the language for a merge row. | ||
45 | /// </summary> | ||
46 | /// <value>Language for the row.</value> | ||
47 | public string Language | ||
48 | { | ||
49 | get { return (string)this.Fields[1].Data; } | ||
50 | set { this.Fields[1].Data = value; } | ||
51 | } | ||
52 | |||
53 | /// <summary> | ||
54 | /// Gets and sets the directory for a merge row. | ||
55 | /// </summary> | ||
56 | /// <value>Direcotory for the row.</value> | ||
57 | public string Directory | ||
58 | { | ||
59 | get { return (string)this.Fields[2].Data; } | ||
60 | set { this.Fields[2].Data = value; } | ||
61 | } | ||
62 | |||
63 | /// <summary> | ||
64 | /// Gets and sets the path to the merge module for a merge row. | ||
65 | /// </summary> | ||
66 | /// <value>Source path for the row.</value> | ||
67 | public string SourceFile | ||
68 | { | ||
69 | get { return (string)this.Fields[3].Data; } | ||
70 | set { this.Fields[3].Data = value; } | ||
71 | } | ||
72 | |||
73 | /// <summary> | ||
74 | /// Gets and sets the disk id the merge module should be placed on for a merge row. | ||
75 | /// </summary> | ||
76 | /// <value>Disk identifier for row.</value> | ||
77 | public int DiskId | ||
78 | { | ||
79 | get { return (int)this.Fields[4].Data; } | ||
80 | set { this.Fields[4].Data = value; } | ||
81 | } | ||
82 | |||
83 | /// <summary> | ||
84 | /// Gets and sets the compression value for a merge row. | ||
85 | /// </summary> | ||
86 | /// <value>Compression for a merge row.</value> | ||
87 | public YesNoType FileCompression | ||
88 | { | ||
89 | get | ||
90 | { | ||
91 | if (null == this.Fields[5].Data) | ||
92 | { | ||
93 | return YesNoType.NotSet; | ||
94 | } | ||
95 | else if (1 == (int)this.Fields[5].Data) | ||
96 | { | ||
97 | return YesNoType.Yes; | ||
98 | } | ||
99 | else if (0 == (int)this.Fields[5].Data) | ||
100 | { | ||
101 | return YesNoType.No; | ||
102 | } | ||
103 | else | ||
104 | { | ||
105 | throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, WixDataStrings.EXP_MergeTableFileCompressionColumnContainsInvalidValue, this.Fields[5].Data)); | ||
106 | } | ||
107 | } | ||
108 | set | ||
109 | { | ||
110 | if (YesNoType.Yes == value) | ||
111 | { | ||
112 | this.Fields[5].Data = 1; | ||
113 | } | ||
114 | else if (YesNoType.No == value) | ||
115 | { | ||
116 | this.Fields[5].Data = 0; | ||
117 | } | ||
118 | else if (YesNoType.NotSet == value) | ||
119 | { | ||
120 | this.Fields[5].Data = null; | ||
121 | } | ||
122 | else | ||
123 | { | ||
124 | throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, WixDataStrings.EXP_CannotSetMergeTableFileCompressionColumnToInvalidValue, value)); | ||
125 | } | ||
126 | } | ||
127 | } | ||
128 | |||
129 | /// <summary> | ||
130 | /// Gets and sets the configuration data for a merge row. | ||
131 | /// </summary> | ||
132 | /// <value>Comma delimited string of "name=value" pairs.</value> | ||
133 | public string ConfigurationData | ||
134 | { | ||
135 | get { return (string)this.Fields[6].Data; } | ||
136 | set { this.Fields[6].Data = value; } | ||
137 | } | ||
138 | |||
139 | /// <summary> | ||
140 | /// Gets and sets the primary feature for a merge row. | ||
141 | /// </summary> | ||
142 | /// <value>The primary feature for a merge row.</value> | ||
143 | public string Feature | ||
144 | { | ||
145 | get { return (string)this.Fields[7].Data; } | ||
146 | set { this.Fields[7].Data = value; } | ||
147 | } | ||
148 | } | ||
149 | } | ||