diff options
Diffstat (limited to '')
-rw-r--r-- | src/WixToolset.Data/IntermediateTupleDefinition.cs | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/WixToolset.Data/IntermediateTupleDefinition.cs b/src/WixToolset.Data/IntermediateTupleDefinition.cs index eb05c28b..102a9f5c 100644 --- a/src/WixToolset.Data/IntermediateTupleDefinition.cs +++ b/src/WixToolset.Data/IntermediateTupleDefinition.cs | |||
@@ -5,50 +5,50 @@ namespace WixToolset.Data | |||
5 | using System; | 5 | using System; |
6 | using SimpleJson; | 6 | using SimpleJson; |
7 | 7 | ||
8 | public class IntermediateTupleDefinition | 8 | public class IntermediateSymbolDefinition |
9 | { | 9 | { |
10 | private object tags; | 10 | private object tags; |
11 | 11 | ||
12 | public IntermediateTupleDefinition(string name, IntermediateFieldDefinition[] fieldDefinitions, Type strongTupleType) | 12 | public IntermediateSymbolDefinition(string name, IntermediateFieldDefinition[] fieldDefinitions, Type strongSymbolType) |
13 | : this(TupleDefinitionType.MustBeFromAnExtension, name, 0, fieldDefinitions, strongTupleType) | 13 | : this(SymbolDefinitionType.MustBeFromAnExtension, name, 0, fieldDefinitions, strongSymbolType) |
14 | { | 14 | { |
15 | } | 15 | } |
16 | 16 | ||
17 | public IntermediateTupleDefinition(string name, int revision, IntermediateFieldDefinition[] fieldDefinitions, Type strongTupleType) | 17 | public IntermediateSymbolDefinition(string name, int revision, IntermediateFieldDefinition[] fieldDefinitions, Type strongSymbolType) |
18 | : this(TupleDefinitionType.MustBeFromAnExtension, name, revision, fieldDefinitions, strongTupleType) | 18 | : this(SymbolDefinitionType.MustBeFromAnExtension, name, revision, fieldDefinitions, strongSymbolType) |
19 | { | 19 | { |
20 | } | 20 | } |
21 | 21 | ||
22 | internal IntermediateTupleDefinition(TupleDefinitionType type, IntermediateFieldDefinition[] fieldDefinitions, Type strongTupleType) | 22 | internal IntermediateSymbolDefinition(SymbolDefinitionType type, IntermediateFieldDefinition[] fieldDefinitions, Type strongSymbolType) |
23 | : this(type, type.ToString(), 0, fieldDefinitions, strongTupleType) | 23 | : this(type, type.ToString(), 0, fieldDefinitions, strongSymbolType) |
24 | { | 24 | { |
25 | } | 25 | } |
26 | 26 | ||
27 | private IntermediateTupleDefinition(TupleDefinitionType type, string name, int revision, IntermediateFieldDefinition[] fieldDefinitions, Type strongTupleType) | 27 | private IntermediateSymbolDefinition(SymbolDefinitionType type, string name, int revision, IntermediateFieldDefinition[] fieldDefinitions, Type strongSymbolType) |
28 | { | 28 | { |
29 | this.Type = type; | 29 | this.Type = type; |
30 | this.Name = name; | 30 | this.Name = name; |
31 | this.Revision = revision; | 31 | this.Revision = revision; |
32 | this.FieldDefinitions = fieldDefinitions; | 32 | this.FieldDefinitions = fieldDefinitions; |
33 | this.StrongTupleType = strongTupleType ?? typeof(IntermediateTuple); | 33 | this.StrongSymbolType = strongSymbolType ?? typeof(IntermediateSymbol); |
34 | #if DEBUG | 34 | #if DEBUG |
35 | if (this.StrongTupleType != typeof(IntermediateTuple) && !this.StrongTupleType.IsSubclassOf(typeof(IntermediateTuple))) { throw new ArgumentException(nameof(strongTupleType)); } | 35 | if (this.StrongSymbolType != typeof(IntermediateSymbol) && !this.StrongSymbolType.IsSubclassOf(typeof(IntermediateSymbol))) { throw new ArgumentException(nameof(strongSymbolType)); } |
36 | #endif | 36 | #endif |
37 | } | 37 | } |
38 | 38 | ||
39 | public int Revision { get; } | 39 | public int Revision { get; } |
40 | 40 | ||
41 | public TupleDefinitionType Type { get; } | 41 | public SymbolDefinitionType Type { get; } |
42 | 42 | ||
43 | public string Name { get; } | 43 | public string Name { get; } |
44 | 44 | ||
45 | public IntermediateFieldDefinition[] FieldDefinitions { get; } | 45 | public IntermediateFieldDefinition[] FieldDefinitions { get; } |
46 | 46 | ||
47 | private Type StrongTupleType { get; } | 47 | private Type StrongSymbolType { get; } |
48 | 48 | ||
49 | public IntermediateTuple CreateTuple(SourceLineNumber sourceLineNumber = null, Identifier id = null) | 49 | public IntermediateSymbol CreateSymbol(SourceLineNumber sourceLineNumber = null, Identifier id = null) |
50 | { | 50 | { |
51 | var result = (this.StrongTupleType == typeof(IntermediateTuple)) ? (IntermediateTuple)Activator.CreateInstance(this.StrongTupleType, this) : (IntermediateTuple)Activator.CreateInstance(this.StrongTupleType); | 51 | var result = (this.StrongSymbolType == typeof(IntermediateSymbol)) ? (IntermediateSymbol)Activator.CreateInstance(this.StrongSymbolType, this) : (IntermediateSymbol)Activator.CreateInstance(this.StrongSymbolType); |
52 | result.SourceLineNumbers = sourceLineNumber; | 52 | result.SourceLineNumbers = sourceLineNumber; |
53 | result.Id = id; | 53 | result.Id = id; |
54 | 54 | ||
@@ -174,7 +174,7 @@ namespace WixToolset.Data | |||
174 | return false; | 174 | return false; |
175 | } | 175 | } |
176 | 176 | ||
177 | internal static IntermediateTupleDefinition Deserialize(JsonObject jsonObject) | 177 | internal static IntermediateSymbolDefinition Deserialize(JsonObject jsonObject) |
178 | { | 178 | { |
179 | var name = jsonObject.GetValueOrDefault<string>("name"); | 179 | var name = jsonObject.GetValueOrDefault<string>("name"); |
180 | var revision = jsonObject.GetValueOrDefault("rev", 0); | 180 | var revision = jsonObject.GetValueOrDefault("rev", 0); |
@@ -191,7 +191,7 @@ namespace WixToolset.Data | |||
191 | fieldDefinitions[i] = new IntermediateFieldDefinition(fieldName, fieldType); | 191 | fieldDefinitions[i] = new IntermediateFieldDefinition(fieldName, fieldType); |
192 | } | 192 | } |
193 | 193 | ||
194 | var definition = new IntermediateTupleDefinition(name, revision, fieldDefinitions, null); | 194 | var definition = new IntermediateSymbolDefinition(name, revision, fieldDefinitions, null); |
195 | 195 | ||
196 | if (tagsJson == null || tagsJson.Count == 0) | 196 | if (tagsJson == null || tagsJson.Count == 0) |
197 | { | 197 | { |