aboutsummaryrefslogtreecommitdiff
path: root/src/TablesAndTuples/WixTableDefinition.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/TablesAndTuples/WixTableDefinition.cs')
-rw-r--r--src/TablesAndTuples/WixTableDefinition.cs13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/TablesAndTuples/WixTableDefinition.cs b/src/TablesAndTuples/WixTableDefinition.cs
index baada41d..fde107ad 100644
--- a/src/TablesAndTuples/WixTableDefinition.cs
+++ b/src/TablesAndTuples/WixTableDefinition.cs
@@ -6,12 +6,13 @@ namespace TablesAndTuples
6{ 6{
7 class WixTableDefinition 7 class WixTableDefinition
8 { 8 {
9 public WixTableDefinition(string name, IEnumerable<WixColumnDefinition> columns, bool unreal, string tupleDefinitionName, bool? tupleIdIsPrimaryKey) 9 public WixTableDefinition(string name, IEnumerable<WixColumnDefinition> columns, bool unreal, bool tupleless, string tupleDefinitionName, bool? tupleIdIsPrimaryKey)
10 { 10 {
11 this.Name = name; 11 this.Name = name;
12 this.Unreal = unreal; 12 this.Unreal = unreal;
13 this.Columns = columns?.ToArray(); 13 this.Columns = columns?.ToArray();
14 this.TupleDefinitionName = tupleDefinitionName ?? name; 14 this.Tupleless = tupleless;
15 this.TupleDefinitionName = tupleless ? null : tupleDefinitionName ?? name.Replace("_", "");
15 this.TupleIdIsPrimaryKey = tupleIdIsPrimaryKey ?? DeriveTupleIdIsPrimaryKey(this.Columns); 16 this.TupleIdIsPrimaryKey = tupleIdIsPrimaryKey ?? DeriveTupleIdIsPrimaryKey(this.Columns);
16 } 17 }
17 18
@@ -25,6 +26,8 @@ namespace TablesAndTuples
25 26
26 public bool TupleIdIsPrimaryKey { get; } 27 public bool TupleIdIsPrimaryKey { get; }
27 28
29 public bool Tupleless { get; }
30
28 static WixTableDefinition Read(XmlReader reader) 31 static WixTableDefinition Read(XmlReader reader)
29 { 32 {
30 var empty = reader.IsEmptyElement; 33 var empty = reader.IsEmptyElement;
@@ -32,6 +35,7 @@ namespace TablesAndTuples
32 string tupleDefinitionName = null; 35 string tupleDefinitionName = null;
33 var unreal = false; 36 var unreal = false;
34 bool? tupleIdIsPrimaryKey = null; 37 bool? tupleIdIsPrimaryKey = null;
38 var tupleless = false;
35 39
36 while (reader.MoveToNextAttribute()) 40 while (reader.MoveToNextAttribute())
37 { 41 {
@@ -46,6 +50,9 @@ namespace TablesAndTuples
46 case "tupleIdIsPrimaryKey": 50 case "tupleIdIsPrimaryKey":
47 tupleIdIsPrimaryKey = reader.Value.Equals("yes"); 51 tupleIdIsPrimaryKey = reader.Value.Equals("yes");
48 break; 52 break;
53 case "tupleless":
54 tupleless = reader.Value.Equals("yes");
55 break;
49 case "unreal": 56 case "unreal":
50 unreal = reader.Value.Equals("yes"); 57 unreal = reader.Value.Equals("yes");
51 break; 58 break;
@@ -91,7 +98,7 @@ namespace TablesAndTuples
91 } 98 }
92 } 99 }
93 100
94 return new WixTableDefinition(name, columns.ToArray(), unreal, tupleDefinitionName, tupleIdIsPrimaryKey); 101 return new WixTableDefinition(name, columns.ToArray(), unreal, tupleless, tupleDefinitionName, tupleIdIsPrimaryKey);
95 } 102 }
96 103
97 static bool DeriveTupleIdIsPrimaryKey(WixColumnDefinition[] columns) 104 static bool DeriveTupleIdIsPrimaryKey(WixColumnDefinition[] columns)