diff options
| author | Rob Mensching <rob@firegiant.com> | 2020-06-25 14:43:50 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2020-06-25 14:50:31 -0700 |
| commit | 38afa9e7bc7eacc021f8805f607368a05751e3c3 (patch) | |
| tree | 803b0a8d9a06a7d6f7c4df408437017ae21a883e /src/test/Example.Extension | |
| parent | 8968578d50858721317d410549a9f9b5c62bf1f7 (diff) | |
| download | wix-38afa9e7bc7eacc021f8805f607368a05751e3c3.tar.gz wix-38afa9e7bc7eacc021f8805f607368a05751e3c3.tar.bz2 wix-38afa9e7bc7eacc021f8805f607368a05751e3c3.zip | |
The Great Tuple to Symbol Rename (tm)
Diffstat (limited to 'src/test/Example.Extension')
7 files changed, 55 insertions, 55 deletions
diff --git a/src/test/Example.Extension/ExampleCompilerExtension.cs b/src/test/Example.Extension/ExampleCompilerExtension.cs index 0005b1d5..5b8d4b3f 100644 --- a/src/test/Example.Extension/ExampleCompilerExtension.cs +++ b/src/test/Example.Extension/ExampleCompilerExtension.cs | |||
| @@ -92,8 +92,8 @@ namespace Example.Extension | |||
| 92 | 92 | ||
| 93 | if (!this.Messaging.EncounteredError) | 93 | if (!this.Messaging.EncounteredError) |
| 94 | { | 94 | { |
| 95 | var tuple = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "Example", id); | 95 | var symbol = this.ParseHelper.CreateSymbol(section, sourceLineNumbers, "Example", id); |
| 96 | tuple.Set(0, value); | 96 | symbol.Set(0, value); |
| 97 | } | 97 | } |
| 98 | } | 98 | } |
| 99 | 99 | ||
| @@ -152,12 +152,12 @@ namespace Example.Extension | |||
| 152 | 152 | ||
| 153 | if (!this.Messaging.EncounteredError) | 153 | if (!this.Messaging.EncounteredError) |
| 154 | { | 154 | { |
| 155 | this.ParseHelper.CreateWixSearchTuple(section, sourceLineNumbers, element.Name.LocalName, id, variable, condition, after, this.BundleExtensionId); | 155 | this.ParseHelper.CreateWixSearchSymbol(section, sourceLineNumbers, element.Name.LocalName, id, variable, condition, after, this.BundleExtensionId); |
| 156 | } | 156 | } |
| 157 | 157 | ||
| 158 | if (!this.Messaging.EncounteredError) | 158 | if (!this.Messaging.EncounteredError) |
| 159 | { | 159 | { |
| 160 | var tuple = section.AddTuple(new ExampleSearchTuple(sourceLineNumbers, id) | 160 | var symbol = section.AddSymbol(new ExampleSearchSymbol(sourceLineNumbers, id) |
| 161 | { | 161 | { |
| 162 | SearchFor = searchFor, | 162 | SearchFor = searchFor, |
| 163 | }); | 163 | }); |
| @@ -176,7 +176,7 @@ namespace Example.Extension | |||
| 176 | { | 176 | { |
| 177 | case "Id": | 177 | case "Id": |
| 178 | var refId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 178 | var refId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 179 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, ExampleTupleDefinitions.ExampleSearch, refId); | 179 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, ExampleSymbolDefinitions.ExampleSearch, refId); |
| 180 | break; | 180 | break; |
| 181 | default: | 181 | default: |
| 182 | this.ParseHelper.UnexpectedAttribute(element, attrib); | 182 | this.ParseHelper.UnexpectedAttribute(element, attrib); |
diff --git a/src/test/Example.Extension/ExampleExtensionData.cs b/src/test/Example.Extension/ExampleExtensionData.cs index 2ba94397..91d60eb9 100644 --- a/src/test/Example.Extension/ExampleExtensionData.cs +++ b/src/test/Example.Extension/ExampleExtensionData.cs | |||
| @@ -9,15 +9,15 @@ namespace Example.Extension | |||
| 9 | { | 9 | { |
| 10 | public string DefaultCulture => null; | 10 | public string DefaultCulture => null; |
| 11 | 11 | ||
| 12 | public Intermediate GetLibrary(ITupleDefinitionCreator tupleDefinitions) | 12 | public Intermediate GetLibrary(ISymbolDefinitionCreator symbolDefinitions) |
| 13 | { | 13 | { |
| 14 | return Intermediate.Load(typeof(ExampleExtensionData).Assembly, "Example.Extension.Example.wixlib", tupleDefinitions); | 14 | return Intermediate.Load(typeof(ExampleExtensionData).Assembly, "Example.Extension.Example.wixlib", symbolDefinitions); |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | public bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition) | 17 | public bool TryGetSymbolDefinitionByName(string name, out IntermediateSymbolDefinition symbolDefinition) |
| 18 | { | 18 | { |
| 19 | tupleDefinition = ExampleTupleDefinitions.ByName(name); | 19 | symbolDefinition = ExampleSymbolDefinitions.ByName(name); |
| 20 | return tupleDefinition != null; | 20 | return symbolDefinition != null; |
| 21 | } | 21 | } |
| 22 | } | 22 | } |
| 23 | } \ No newline at end of file | 23 | } \ No newline at end of file |
diff --git a/src/test/Example.Extension/ExampleSearchTuple.cs b/src/test/Example.Extension/ExampleSearchTuple.cs index 353ef158..40a39292 100644 --- a/src/test/Example.Extension/ExampleSearchTuple.cs +++ b/src/test/Example.Extension/ExampleSearchTuple.cs | |||
| @@ -4,27 +4,27 @@ namespace Example.Extension | |||
| 4 | { | 4 | { |
| 5 | using WixToolset.Data; | 5 | using WixToolset.Data; |
| 6 | 6 | ||
| 7 | public enum ExampleSearchTupleFields | 7 | public enum ExampleSearchSymbolFields |
| 8 | { | 8 | { |
| 9 | SearchFor, | 9 | SearchFor, |
| 10 | } | 10 | } |
| 11 | 11 | ||
| 12 | public class ExampleSearchTuple : IntermediateTuple | 12 | public class ExampleSearchSymbol : IntermediateSymbol |
| 13 | { | 13 | { |
| 14 | public ExampleSearchTuple() : base(ExampleTupleDefinitions.ExampleSearch, null, null) | 14 | public ExampleSearchSymbol() : base(ExampleSymbolDefinitions.ExampleSearch, null, null) |
| 15 | { | 15 | { |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | public ExampleSearchTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(ExampleTupleDefinitions.ExampleSearch, sourceLineNumber, id) | 18 | public ExampleSearchSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(ExampleSymbolDefinitions.ExampleSearch, sourceLineNumber, id) |
| 19 | { | 19 | { |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | public IntermediateField this[ExampleTupleFields index] => this.Fields[(int)index]; | 22 | public IntermediateField this[ExampleSymbolFields index] => this.Fields[(int)index]; |
| 23 | 23 | ||
| 24 | public string SearchFor | 24 | public string SearchFor |
| 25 | { | 25 | { |
| 26 | get => this.Fields[(int)ExampleSearchTupleFields.SearchFor]?.AsString(); | 26 | get => this.Fields[(int)ExampleSearchSymbolFields.SearchFor]?.AsString(); |
| 27 | set => this.Set((int)ExampleSearchTupleFields.SearchFor, value); | 27 | set => this.Set((int)ExampleSearchSymbolFields.SearchFor, value); |
| 28 | } | 28 | } |
| 29 | } | 29 | } |
| 30 | } | 30 | } |
diff --git a/src/test/Example.Extension/ExampleTableDefinitions.cs b/src/test/Example.Extension/ExampleTableDefinitions.cs index 4901cc09..a2b81698 100644 --- a/src/test/Example.Extension/ExampleTableDefinitions.cs +++ b/src/test/Example.Extension/ExampleTableDefinitions.cs | |||
| @@ -8,14 +8,14 @@ namespace Example.Extension | |||
| 8 | { | 8 | { |
| 9 | public static readonly TableDefinition ExampleTable = new TableDefinition( | 9 | public static readonly TableDefinition ExampleTable = new TableDefinition( |
| 10 | "Wix4Example", | 10 | "Wix4Example", |
| 11 | ExampleTupleDefinitions.Example, | 11 | ExampleSymbolDefinitions.Example, |
| 12 | new[] | 12 | new[] |
| 13 | { | 13 | { |
| 14 | new ColumnDefinition("Example", ColumnType.String, 72, true, false, ColumnCategory.Identifier), | 14 | new ColumnDefinition("Example", ColumnType.String, 72, true, false, ColumnCategory.Identifier), |
| 15 | new ColumnDefinition("Value", ColumnType.String, 0, false, false, ColumnCategory.Formatted), | 15 | new ColumnDefinition("Value", ColumnType.String, 0, false, false, ColumnCategory.Formatted), |
| 16 | }, | 16 | }, |
| 17 | strongRowType: typeof(ExampleRow), | 17 | strongRowType: typeof(ExampleRow), |
| 18 | tupleIdIsPrimaryKey: true | 18 | symbolIdIsPrimaryKey: true |
| 19 | ); | 19 | ); |
| 20 | 20 | ||
| 21 | public static readonly TableDefinition NotInAll = new TableDefinition( | 21 | public static readonly TableDefinition NotInAll = new TableDefinition( |
| @@ -26,7 +26,7 @@ namespace Example.Extension | |||
| 26 | new ColumnDefinition("Example", ColumnType.String, 72, true, false, ColumnCategory.Identifier), | 26 | new ColumnDefinition("Example", ColumnType.String, 72, true, false, ColumnCategory.Identifier), |
| 27 | new ColumnDefinition("Value", ColumnType.String, 0, false, false, ColumnCategory.Formatted), | 27 | new ColumnDefinition("Value", ColumnType.String, 0, false, false, ColumnCategory.Formatted), |
| 28 | }, | 28 | }, |
| 29 | tupleIdIsPrimaryKey: true | 29 | symbolIdIsPrimaryKey: true |
| 30 | ); | 30 | ); |
| 31 | 31 | ||
| 32 | public static readonly TableDefinition[] All = new[] { ExampleTable }; | 32 | public static readonly TableDefinition[] All = new[] { ExampleTable }; |
diff --git a/src/test/Example.Extension/ExampleTuple.cs b/src/test/Example.Extension/ExampleTuple.cs index f2bcb925..314087e9 100644 --- a/src/test/Example.Extension/ExampleTuple.cs +++ b/src/test/Example.Extension/ExampleTuple.cs | |||
| @@ -4,27 +4,27 @@ namespace Example.Extension | |||
| 4 | { | 4 | { |
| 5 | using WixToolset.Data; | 5 | using WixToolset.Data; |
| 6 | 6 | ||
| 7 | public enum ExampleTupleFields | 7 | public enum ExampleSymbolFields |
| 8 | { | 8 | { |
| 9 | Value, | 9 | Value, |
| 10 | } | 10 | } |
| 11 | 11 | ||
| 12 | public class ExampleTuple : IntermediateTuple | 12 | public class ExampleSymbol : IntermediateSymbol |
| 13 | { | 13 | { |
| 14 | public ExampleTuple() : base(ExampleTupleDefinitions.Example, null, null) | 14 | public ExampleSymbol() : base(ExampleSymbolDefinitions.Example, null, null) |
| 15 | { | 15 | { |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | public ExampleTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(ExampleTupleDefinitions.Example, sourceLineNumber, id) | 18 | public ExampleSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(ExampleSymbolDefinitions.Example, sourceLineNumber, id) |
| 19 | { | 19 | { |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | public IntermediateField this[ExampleTupleFields index] => this.Fields[(int)index]; | 22 | public IntermediateField this[ExampleSymbolFields index] => this.Fields[(int)index]; |
| 23 | 23 | ||
| 24 | public string Value | 24 | public string Value |
| 25 | { | 25 | { |
| 26 | get => this.Fields[(int)ExampleTupleFields.Value]?.AsString(); | 26 | get => this.Fields[(int)ExampleSymbolFields.Value]?.AsString(); |
| 27 | set => this.Set((int)ExampleTupleFields.Value, value); | 27 | set => this.Set((int)ExampleSymbolFields.Value, value); |
| 28 | } | 28 | } |
| 29 | } | 29 | } |
| 30 | } | 30 | } |
diff --git a/src/test/Example.Extension/ExampleTupleDefinitions.cs b/src/test/Example.Extension/ExampleTupleDefinitions.cs index 446c2c45..f13d716d 100644 --- a/src/test/Example.Extension/ExampleTupleDefinitions.cs +++ b/src/test/Example.Extension/ExampleTupleDefinitions.cs | |||
| @@ -6,58 +6,58 @@ namespace Example.Extension | |||
| 6 | using WixToolset.Data; | 6 | using WixToolset.Data; |
| 7 | using WixToolset.Data.Burn; | 7 | using WixToolset.Data.Burn; |
| 8 | 8 | ||
| 9 | public enum ExampleTupleDefinitionType | 9 | public enum ExampleSymbolDefinitionType |
| 10 | { | 10 | { |
| 11 | Example, | 11 | Example, |
| 12 | ExampleSearch, | 12 | ExampleSearch, |
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | public static class ExampleTupleDefinitions | 15 | public static class ExampleSymbolDefinitions |
| 16 | { | 16 | { |
| 17 | public static readonly IntermediateTupleDefinition Example = new IntermediateTupleDefinition( | 17 | public static readonly IntermediateSymbolDefinition Example = new IntermediateSymbolDefinition( |
| 18 | ExampleTupleDefinitionType.Example.ToString(), | 18 | ExampleSymbolDefinitionType.Example.ToString(), |
| 19 | new[] | 19 | new[] |
| 20 | { | 20 | { |
| 21 | new IntermediateFieldDefinition(nameof(ExampleTupleFields.Value), IntermediateFieldType.String), | 21 | new IntermediateFieldDefinition(nameof(ExampleSymbolFields.Value), IntermediateFieldType.String), |
| 22 | }, | 22 | }, |
| 23 | typeof(ExampleTuple)); | 23 | typeof(ExampleSymbol)); |
| 24 | 24 | ||
| 25 | public static readonly IntermediateTupleDefinition ExampleSearch = new IntermediateTupleDefinition( | 25 | public static readonly IntermediateSymbolDefinition ExampleSearch = new IntermediateSymbolDefinition( |
| 26 | ExampleTupleDefinitionType.ExampleSearch.ToString(), | 26 | ExampleSymbolDefinitionType.ExampleSearch.ToString(), |
| 27 | new[] | 27 | new[] |
| 28 | { | 28 | { |
| 29 | new IntermediateFieldDefinition(nameof(ExampleSearchTupleFields.SearchFor), IntermediateFieldType.String), | 29 | new IntermediateFieldDefinition(nameof(ExampleSearchSymbolFields.SearchFor), IntermediateFieldType.String), |
| 30 | }, | 30 | }, |
| 31 | typeof(ExampleSearchTuple)); | 31 | typeof(ExampleSearchSymbol)); |
| 32 | 32 | ||
| 33 | static ExampleTupleDefinitions() | 33 | static ExampleSymbolDefinitions() |
| 34 | { | 34 | { |
| 35 | ExampleSearch.AddTag(BurnConstants.BundleExtensionSearchTupleDefinitionTag); | 35 | ExampleSearch.AddTag(BurnConstants.BundleExtensionSearchSymbolDefinitionTag); |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | public static bool TryGetTupleType(string name, out ExampleTupleDefinitionType type) | 38 | public static bool TryGetSymbolType(string name, out ExampleSymbolDefinitionType type) |
| 39 | { | 39 | { |
| 40 | return Enum.TryParse(name, out type); | 40 | return Enum.TryParse(name, out type); |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | public static IntermediateTupleDefinition ByName(string name) | 43 | public static IntermediateSymbolDefinition ByName(string name) |
| 44 | { | 44 | { |
| 45 | if (!TryGetTupleType(name, out var type)) | 45 | if (!TryGetSymbolType(name, out var type)) |
| 46 | { | 46 | { |
| 47 | return null; | 47 | return null; |
| 48 | } | 48 | } |
| 49 | return ByType(type); | 49 | return ByType(type); |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | public static IntermediateTupleDefinition ByType(ExampleTupleDefinitionType type) | 52 | public static IntermediateSymbolDefinition ByType(ExampleSymbolDefinitionType type) |
| 53 | { | 53 | { |
| 54 | switch (type) | 54 | switch (type) |
| 55 | { | 55 | { |
| 56 | case ExampleTupleDefinitionType.Example: | 56 | case ExampleSymbolDefinitionType.Example: |
| 57 | return ExampleTupleDefinitions.Example; | 57 | return ExampleSymbolDefinitions.Example; |
| 58 | 58 | ||
| 59 | case ExampleTupleDefinitionType.ExampleSearch: | 59 | case ExampleSymbolDefinitionType.ExampleSearch: |
| 60 | return ExampleTupleDefinitions.ExampleSearch; | 60 | return ExampleSymbolDefinitions.ExampleSearch; |
| 61 | 61 | ||
| 62 | default: | 62 | default: |
| 63 | throw new ArgumentOutOfRangeException(nameof(type)); | 63 | throw new ArgumentOutOfRangeException(nameof(type)); |
diff --git a/src/test/Example.Extension/ExampleWindowsInstallerBackendExtension.cs b/src/test/Example.Extension/ExampleWindowsInstallerBackendExtension.cs index 4ce4635f..2c108d96 100644 --- a/src/test/Example.Extension/ExampleWindowsInstallerBackendExtension.cs +++ b/src/test/Example.Extension/ExampleWindowsInstallerBackendExtension.cs | |||
| @@ -11,23 +11,23 @@ namespace Example.Extension | |||
| 11 | { | 11 | { |
| 12 | public override IEnumerable<TableDefinition> TableDefinitions => ExampleTableDefinitions.All; | 12 | public override IEnumerable<TableDefinition> TableDefinitions => ExampleTableDefinitions.All; |
| 13 | 13 | ||
| 14 | public override bool TryAddTupleToOutput(IntermediateSection section, IntermediateTuple tuple, WindowsInstallerData output, TableDefinitionCollection tableDefinitions) | 14 | public override bool TryAddSymbolToOutput(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData output, TableDefinitionCollection tableDefinitions) |
| 15 | { | 15 | { |
| 16 | if (ExampleTupleDefinitions.TryGetTupleType(tuple.Definition.Name, out var tupleType)) | 16 | if (ExampleSymbolDefinitions.TryGetSymbolType(symbol.Definition.Name, out var symbolType)) |
| 17 | { | 17 | { |
| 18 | switch (tupleType) | 18 | switch (symbolType) |
| 19 | { | 19 | { |
| 20 | case ExampleTupleDefinitionType.Example: | 20 | case ExampleSymbolDefinitionType.Example: |
| 21 | { | 21 | { |
| 22 | var row = (ExampleRow)this.BackendHelper.CreateRow(section, tuple, output, ExampleTableDefinitions.ExampleTable); | 22 | var row = (ExampleRow)this.BackendHelper.CreateRow(section, symbol, output, ExampleTableDefinitions.ExampleTable); |
| 23 | row.Example = tuple.Id.Id; | 23 | row.Example = symbol.Id.Id; |
| 24 | row.Value = tuple[0].AsString(); | 24 | row.Value = symbol[0].AsString(); |
| 25 | } | 25 | } |
| 26 | return true; | 26 | return true; |
| 27 | } | 27 | } |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | return base.TryAddTupleToOutput(section, tuple, output, tableDefinitions); | 30 | return base.TryAddSymbolToOutput(section, symbol, output, tableDefinitions); |
| 31 | } | 31 | } |
| 32 | } | 32 | } |
| 33 | } | 33 | } |
