diff options
| author | Rob Mensching <rob@firegiant.com> | 2017-12-02 00:44:45 -0800 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2017-12-02 00:44:45 -0800 |
| commit | 53e877183abe0dbbb623c39380101bc369e9f265 (patch) | |
| tree | 2b1a35e142d76013ba28d0a50e894ff477ee247a /src/WixToolset.Data/SimpleTupleDefinitionCreator.cs | |
| parent | 414bf166e07703056ad186fa8ec23a4119dd9993 (diff) | |
| download | wix-53e877183abe0dbbb623c39380101bc369e9f265.tar.gz wix-53e877183abe0dbbb623c39380101bc369e9f265.tar.bz2 wix-53e877183abe0dbbb623c39380101bc369e9f265.zip | |
Support tuples from extensions and make SourcePath a path instead of string
Diffstat (limited to 'src/WixToolset.Data/SimpleTupleDefinitionCreator.cs')
| -rw-r--r-- | src/WixToolset.Data/SimpleTupleDefinitionCreator.cs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/WixToolset.Data/SimpleTupleDefinitionCreator.cs b/src/WixToolset.Data/SimpleTupleDefinitionCreator.cs index b9d0b620..6a86639a 100644 --- a/src/WixToolset.Data/SimpleTupleDefinitionCreator.cs +++ b/src/WixToolset.Data/SimpleTupleDefinitionCreator.cs | |||
| @@ -2,12 +2,27 @@ | |||
| 2 | 2 | ||
| 3 | namespace WixToolset.Data | 3 | namespace WixToolset.Data |
| 4 | { | 4 | { |
| 5 | using System.Collections.Generic; | ||
| 6 | |||
| 5 | internal class SimpleTupleDefinitionCreator : ITupleDefinitionCreator | 7 | internal class SimpleTupleDefinitionCreator : ITupleDefinitionCreator |
| 6 | { | 8 | { |
| 9 | private Dictionary<string, IntermediateTupleDefinition> CustomDefinitionByName { get; } = new Dictionary<string, IntermediateTupleDefinition>(); | ||
| 10 | |||
| 11 | public void AddCustomTupleDefinition(IntermediateTupleDefinition definition) | ||
| 12 | { | ||
| 13 | this.CustomDefinitionByName.Add(definition.Name, definition); | ||
| 14 | } | ||
| 15 | |||
| 7 | public bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition) | 16 | public bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition) |
| 8 | { | 17 | { |
| 9 | tupleDefinition = TupleDefinitions.ByName(name); | 18 | tupleDefinition = TupleDefinitions.ByName(name); |
| 19 | |||
| 20 | if (tupleDefinition == null) | ||
| 21 | { | ||
| 22 | tupleDefinition = this.CustomDefinitionByName.GetValueOrDefault(name); | ||
| 23 | } | ||
| 24 | |||
| 10 | return tupleDefinition != null; | 25 | return tupleDefinition != null; |
| 11 | } | 26 | } |
| 12 | } | 27 | } |
| 13 | } \ No newline at end of file | 28 | } |
