aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Data/WindowsInstaller
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Data/WindowsInstaller')
-rw-r--r--src/WixToolset.Data/WindowsInstaller/TableDefinition.cs34
1 files changed, 9 insertions, 25 deletions
diff --git a/src/WixToolset.Data/WindowsInstaller/TableDefinition.cs b/src/WixToolset.Data/WindowsInstaller/TableDefinition.cs
index bc7fb537..ee8ab0c1 100644
--- a/src/WixToolset.Data/WindowsInstaller/TableDefinition.cs
+++ b/src/WixToolset.Data/WindowsInstaller/TableDefinition.cs
@@ -4,7 +4,7 @@ namespace WixToolset.Data.WindowsInstaller
4{ 4{
5 using System; 5 using System;
6 using System.Collections.Generic; 6 using System.Collections.Generic;
7 using System.Collections.ObjectModel; 7 using System.Linq;
8 using System.Xml; 8 using System.Xml;
9 9
10 /// <summary> 10 /// <summary>
@@ -24,14 +24,12 @@ namespace WixToolset.Data.WindowsInstaller
24 /// <param name="name">Name of table to create.</param> 24 /// <param name="name">Name of table to create.</param>
25 /// <param name="columns">Column definitions for the table.</param> 25 /// <param name="columns">Column definitions for the table.</param>
26 /// <param name="unreal">Flag if table is unreal.</param> 26 /// <param name="unreal">Flag if table is unreal.</param>
27 /// <param name="bootstrapperApplicationData">Flag if table is part of UX Manifest.</param> 27 public TableDefinition(string name, IEnumerable<ColumnDefinition> columns, bool unreal = false)
28 public TableDefinition(string name, ColumnDefinition[] columns, bool unreal = false, bool bootstrapperApplicationData = false)
29 { 28 {
30 this.Name = name; 29 this.Name = name;
31 this.Unreal = unreal; 30 this.Unreal = unreal;
32 this.BootstrapperApplicationData = bootstrapperApplicationData;
33 31
34 this.Columns = columns; 32 this.Columns = columns.ToArray();
35 } 33 }
36 34
37 /// <summary> 35 /// <summary>
@@ -47,12 +45,6 @@ namespace WixToolset.Data.WindowsInstaller
47 public bool Unreal { get; private set; } 45 public bool Unreal { get; private set; }
48 46
49 /// <summary> 47 /// <summary>
50 /// Gets if the table is a part of the bootstrapper application data manifest.
51 /// </summary>
52 /// <value>Flag if table is a part of the bootstrapper application data manifest.</value>
53 public bool BootstrapperApplicationData { get; private set; }
54
55 /// <summary>
56 /// Gets the collection of column definitions for this table. 48 /// Gets the collection of column definitions for this table.
57 /// </summary> 49 /// </summary>
58 /// <value>Collection of column definitions for this table.</value> 50 /// <value>Collection of column definitions for this table.</value>
@@ -82,7 +74,7 @@ namespace WixToolset.Data.WindowsInstaller
82 } 74 }
83 75
84 // compare the table names 76 // compare the table names
85 int ret = String.Compare(this.Name, updated.Name, StringComparison.Ordinal); 77 var ret = String.Compare(this.Name, updated.Name, StringComparison.Ordinal);
86 78
87 // compare the column count 79 // compare the column count
88 if (0 == ret) 80 if (0 == ret)
@@ -91,10 +83,10 @@ namespace WixToolset.Data.WindowsInstaller
91 ret = Math.Min(0, updated.Columns.Length - this.Columns.Length); 83 ret = Math.Min(0, updated.Columns.Length - this.Columns.Length);
92 84
93 // compare name, type, and length of each column 85 // compare name, type, and length of each column
94 for (int i = 0; 0 == ret && this.Columns.Length > i; i++) 86 for (var i = 0; 0 == ret && this.Columns.Length > i; i++)
95 { 87 {
96 ColumnDefinition thisColumnDef = this.Columns[i]; 88 var thisColumnDef = this.Columns[i];
97 ColumnDefinition updatedColumnDef = updated.Columns[i]; 89 var updatedColumnDef = updated.Columns[i];
98 90
99 ret = thisColumnDef.CompareTo(updatedColumnDef); 91 ret = thisColumnDef.CompareTo(updatedColumnDef);
100 } 92 }
@@ -125,9 +117,6 @@ namespace WixToolset.Data.WindowsInstaller
125 case "unreal": 117 case "unreal":
126 unreal = reader.Value.Equals("yes"); 118 unreal = reader.Value.Equals("yes");
127 break; 119 break;
128 case "bootstrapperApplicationData":
129 bootstrapperApplicationData = reader.Value.Equals("yes");
130 break;
131 } 120 }
132 } 121 }
133 122
@@ -181,7 +170,7 @@ namespace WixToolset.Data.WindowsInstaller
181 } 170 }
182 } 171 }
183 172
184 return new TableDefinition(name, columns.ToArray(), unreal, bootstrapperApplicationData); 173 return new TableDefinition(name, columns.ToArray(), unreal);
185 } 174 }
186 175
187 /// <summary> 176 /// <summary>
@@ -199,12 +188,7 @@ namespace WixToolset.Data.WindowsInstaller
199 writer.WriteAttributeString("unreal", "yes"); 188 writer.WriteAttributeString("unreal", "yes");
200 } 189 }
201 190
202 if (this.BootstrapperApplicationData) 191 foreach (var columnDefinition in this.Columns)
203 {
204 writer.WriteAttributeString("bootstrapperApplicationData", "yes");
205 }
206
207 foreach (ColumnDefinition columnDefinition in this.Columns)
208 { 192 {
209 columnDefinition.Write(writer); 193 columnDefinition.Write(writer);
210 } 194 }