diff options
Diffstat (limited to 'src/WixToolset.Core/ExtensibilityServices/TupleDefinitionCreator.cs')
-rw-r--r-- | src/WixToolset.Core/ExtensibilityServices/TupleDefinitionCreator.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/WixToolset.Core/ExtensibilityServices/TupleDefinitionCreator.cs b/src/WixToolset.Core/ExtensibilityServices/TupleDefinitionCreator.cs index 4075def8..b442da2b 100644 --- a/src/WixToolset.Core/ExtensibilityServices/TupleDefinitionCreator.cs +++ b/src/WixToolset.Core/ExtensibilityServices/TupleDefinitionCreator.cs | |||
@@ -19,8 +19,16 @@ namespace WixToolset.Core.ExtensibilityServices | |||
19 | 19 | ||
20 | private IEnumerable<IExtensionData> ExtensionData { get; set; } | 20 | private IEnumerable<IExtensionData> ExtensionData { get; set; } |
21 | 21 | ||
22 | private Dictionary<string, IntermediateTupleDefinition> CustomDefinitionByName { get; } = new Dictionary<string, IntermediateTupleDefinition>(); | ||
23 | |||
24 | public void AddCustomTupleDefinition(IntermediateTupleDefinition definition) | ||
25 | { | ||
26 | this.CustomDefinitionByName.Add(definition.Name, definition); | ||
27 | } | ||
28 | |||
22 | public bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition) | 29 | public bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition) |
23 | { | 30 | { |
31 | // First, look in the built-ins. | ||
24 | tupleDefinition = TupleDefinitions.ByName(name); | 32 | tupleDefinition = TupleDefinitions.ByName(name); |
25 | 33 | ||
26 | if (tupleDefinition == null) | 34 | if (tupleDefinition == null) |
@@ -30,6 +38,7 @@ namespace WixToolset.Core.ExtensibilityServices | |||
30 | this.LoadExtensionData(); | 38 | this.LoadExtensionData(); |
31 | } | 39 | } |
32 | 40 | ||
41 | // Second, look in the extensions. | ||
33 | foreach (var data in this.ExtensionData) | 42 | foreach (var data in this.ExtensionData) |
34 | { | 43 | { |
35 | if (data.TryGetTupleDefinitionByName(name, out tupleDefinition)) | 44 | if (data.TryGetTupleDefinitionByName(name, out tupleDefinition)) |
@@ -37,6 +46,12 @@ namespace WixToolset.Core.ExtensibilityServices | |||
37 | break; | 46 | break; |
38 | } | 47 | } |
39 | } | 48 | } |
49 | |||
50 | // Finally, look in the custom tuple definitions provided during an intermediate load. | ||
51 | if (tupleDefinition == null) | ||
52 | { | ||
53 | this.CustomDefinitionByName.TryGetValue(name, out tupleDefinition); | ||
54 | } | ||
40 | } | 55 | } |
41 | 56 | ||
42 | return tupleDefinition != null; | 57 | return tupleDefinition != null; |