From 0ea7e4a065e5c65dd59396dbdf3b7ba1b85c6c4a Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 27 Jun 2020 02:50:45 -0700 Subject: The Great Tuple to Symbol Rename (tm) --- src/wixext/DependencyCompiler.cs | 38 ++++++++++---------- src/wixext/DependencyExtensionData.cs | 10 +++--- src/wixext/DependencyTableDefinitions.cs | 12 +++---- src/wixext/Tuples/DependencyTupleDefinitions.cs | 18 +++++----- src/wixext/Tuples/WixDependencyRefTuple.cs | 34 +++++++++--------- src/wixext/Tuples/WixDependencyTuple.cs | 46 ++++++++++++------------- 6 files changed, 79 insertions(+), 79 deletions(-) diff --git a/src/wixext/DependencyCompiler.cs b/src/wixext/DependencyCompiler.cs index 4ec6f477..018a507a 100644 --- a/src/wixext/DependencyCompiler.cs +++ b/src/wixext/DependencyCompiler.cs @@ -8,8 +8,8 @@ namespace WixToolset.Dependency using System.Text; using System.Xml.Linq; using WixToolset.Data; - using WixToolset.Data.Tuples; - using WixToolset.Dependency.Tuples; + using WixToolset.Data.Symbols; + using WixToolset.Dependency.Symbols; using WixToolset.Extensibility; using WixToolset.Extensibility.Data; @@ -207,9 +207,9 @@ namespace WixToolset.Dependency if (!this.Messaging.EncounteredError) { - // Create the provider tuple for the bundle. The Component_ field is required + // Create the provider symbol for the bundle. The Component_ field is required // in the table definition but unused for bundles, so just set it to the valid ID. - section.AddTuple(new WixDependencyProviderTuple(sourceLineNumbers, id) + section.AddSymbol(new WixDependencyProviderSymbol(sourceLineNumbers, id) { ComponentRef = id.Id, ProviderKey = providerKey, @@ -290,7 +290,7 @@ namespace WixToolset.Dependency else if (PackageType.None == packageType) { // Make sure the ProductCode is authored and set the key. - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.Property, "ProductCode"); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.Property, "ProductCode"); key = "!(bind.property.ProductCode)"; } @@ -344,7 +344,7 @@ namespace WixToolset.Dependency if (!this.Messaging.EncounteredError) { - var tuple = section.AddTuple(new WixDependencyProviderTuple(sourceLineNumbers, id) + var symbol = section.AddSymbol(new WixDependencyProviderSymbol(sourceLineNumbers, id) { ComponentRef = parentId, ProviderKey = key, @@ -352,12 +352,12 @@ namespace WixToolset.Dependency if (!String.IsNullOrEmpty(version)) { - tuple.Version = version; + symbol.Version = version; } if (!String.IsNullOrEmpty(displayName)) { - tuple.DisplayName = displayName; + symbol.DisplayName = displayName; } if (PackageType.None == packageType) @@ -379,18 +379,18 @@ namespace WixToolset.Dependency var root = RegistryRootType.MachineUser; var value = "[ProductCode]"; - this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, root, keyProvides, null, value, parentId, false); + this.ParseHelper.CreateRegistrySymbol(section, sourceLineNumbers, root, keyProvides, null, value, parentId, false); value = !String.IsNullOrEmpty(version) ? version : "[ProductVersion]"; - var versionRegistryTuple = - this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, root, keyProvides, "Version", value, parentId, false); + var versionRegistrySymbol = + this.ParseHelper.CreateRegistrySymbol(section, sourceLineNumbers, root, keyProvides, "Version", value, parentId, false); value = !String.IsNullOrEmpty(displayName) ? displayName : "[ProductName]"; - this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, root, keyProvides, "DisplayName", value, parentId, false); + this.ParseHelper.CreateRegistrySymbol(section, sourceLineNumbers, root, keyProvides, "DisplayName", value, parentId, false); // Use the Version registry value and use that as a potential key path. keyPath = this.CreateComponentKeyPath(); - keyPath.Id = versionRegistryTuple.Id; + keyPath.Id = versionRegistrySymbol.Id; keyPath.Explicit = false; keyPath.Type = PossibleKeyPathType.Registry; } @@ -494,7 +494,7 @@ namespace WixToolset.Dependency this.AddReferenceToWixDependencyRequire(section, sourceLineNumbers); } - var tuple = section.AddTuple(new WixDependencyTuple(sourceLineNumbers, id) + var symbol = section.AddSymbol(new WixDependencySymbol(sourceLineNumbers, id) { ProviderKey = providerKey, MinVersion = minVersion, @@ -503,13 +503,13 @@ namespace WixToolset.Dependency if (0 != attributes) { - tuple.Attributes = attributes; + symbol.Attributes = attributes; } - // Create the relationship between this WixDependency tuple and the WixDependencyProvider tuple. + // Create the relationship between this WixDependency symbol and the WixDependencyProvider symbol. if (!String.IsNullOrEmpty(providerId)) { - section.AddTuple(new WixDependencyRefTuple(sourceLineNumbers) + section.AddSymbol(new WixDependencyRefSymbol(sourceLineNumbers) { WixDependencyProviderRef = providerId, WixDependencyRef = id.Id, @@ -565,10 +565,10 @@ namespace WixToolset.Dependency } // Create a link dependency on the row that contains information we'll need during bind. - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, DependencyTupleDefinitions.WixDependency, id); + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, DependencySymbolDefinitions.WixDependency, id); // Create the relationship between the WixDependency row and the parent WixDependencyProvider row. - section.AddTuple(new WixDependencyRefTuple(sourceLineNumbers) + section.AddSymbol(new WixDependencyRefSymbol(sourceLineNumbers) { WixDependencyProviderRef = providerId, WixDependencyRef = id, diff --git a/src/wixext/DependencyExtensionData.cs b/src/wixext/DependencyExtensionData.cs index e92aeff1..e7d8746c 100644 --- a/src/wixext/DependencyExtensionData.cs +++ b/src/wixext/DependencyExtensionData.cs @@ -16,15 +16,15 @@ namespace WixToolset.Dependency /// The default culture. public override string DefaultCulture => "en-US"; - public override bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition) + public override bool TryGetSymbolDefinitionByName(string name, out IntermediateSymbolDefinition symbolDefinition) { - tupleDefinition = DependencyTupleDefinitions.ByName(name); - return tupleDefinition != null; + symbolDefinition = DependencySymbolDefinitions.ByName(name); + return symbolDefinition != null; } - public override Intermediate GetLibrary(ITupleDefinitionCreator tupleDefinitions) + public override Intermediate GetLibrary(ISymbolDefinitionCreator symbolDefinitions) { - return Intermediate.Load(typeof(DependencyExtensionData).Assembly, "WixToolset.Dependency.dependency.wixlib", tupleDefinitions); + return Intermediate.Load(typeof(DependencyExtensionData).Assembly, "WixToolset.Dependency.dependency.wixlib", symbolDefinitions); } } } diff --git a/src/wixext/DependencyTableDefinitions.cs b/src/wixext/DependencyTableDefinitions.cs index d563208d..d3f643e4 100644 --- a/src/wixext/DependencyTableDefinitions.cs +++ b/src/wixext/DependencyTableDefinitions.cs @@ -9,7 +9,7 @@ namespace WixToolset.Dependency { public static readonly TableDefinition WixDependencyProvider = new TableDefinition( "WixDependencyProvider", - TupleDefinitions.WixDependencyProvider, + SymbolDefinitions.WixDependencyProvider, new[] { new ColumnDefinition("WixDependencyProvider", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "The non-localized primary key for the table.", modularizeType: ColumnModularizeType.Column), @@ -19,12 +19,12 @@ namespace WixToolset.Dependency new ColumnDefinition("DisplayName", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Text, description: "The display name of the package."), new ColumnDefinition("Attributes", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, minValue: 0, maxValue: 2147483647, description: "A 32-bit word that specifies the attribute flags to be applied."), }, - tupleIdIsPrimaryKey: true + symbolIdIsPrimaryKey: true ); public static readonly TableDefinition WixDependency = new TableDefinition( "WixDependency", - DependencyTupleDefinitions.WixDependency, + DependencySymbolDefinitions.WixDependency, new[] { new ColumnDefinition("WixDependency", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "The non-localized primary key for the table.", modularizeType: ColumnModularizeType.Column), @@ -33,18 +33,18 @@ namespace WixToolset.Dependency new ColumnDefinition("MaxVersion", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Version, description: "The maximum version of the provider supported."), new ColumnDefinition("Attributes", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, minValue: 0, maxValue: 2147483647, description: "A 32-bit word that specifies the attribute flags to be applied."), }, - tupleIdIsPrimaryKey: true + symbolIdIsPrimaryKey: true ); public static readonly TableDefinition WixDependencyRef = new TableDefinition( "WixDependencyRef", - DependencyTupleDefinitions.WixDependencyRef, + DependencySymbolDefinitions.WixDependencyRef, new[] { new ColumnDefinition("WixDependencyProvider_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "WixDependencyProvider", keyColumn: 1, description: "Foreign key into the Component table.", modularizeType: ColumnModularizeType.Column), new ColumnDefinition("WixDependency_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "WixDependency", keyColumn: 1, description: "Foreign key into the WixDependency table.", modularizeType: ColumnModularizeType.Column), }, - tupleIdIsPrimaryKey: false + symbolIdIsPrimaryKey: false ); public static readonly TableDefinition[] All = new[] diff --git a/src/wixext/Tuples/DependencyTupleDefinitions.cs b/src/wixext/Tuples/DependencyTupleDefinitions.cs index 3309b0a5..5a18ae4b 100644 --- a/src/wixext/Tuples/DependencyTupleDefinitions.cs +++ b/src/wixext/Tuples/DependencyTupleDefinitions.cs @@ -5,19 +5,19 @@ namespace WixToolset.Dependency using System; using WixToolset.Data; - public enum DependencyTupleDefinitionType + public enum DependencySymbolDefinitionType { WixDependency, WixDependencyRef, } - public static partial class DependencyTupleDefinitions + public static partial class DependencySymbolDefinitions { public static readonly Version Version = new Version("4.0.0"); - public static IntermediateTupleDefinition ByName(string name) + public static IntermediateSymbolDefinition ByName(string name) { - if (!Enum.TryParse(name, out DependencyTupleDefinitionType type)) + if (!Enum.TryParse(name, out DependencySymbolDefinitionType type)) { return null; } @@ -25,15 +25,15 @@ namespace WixToolset.Dependency return ByType(type); } - public static IntermediateTupleDefinition ByType(DependencyTupleDefinitionType type) + public static IntermediateSymbolDefinition ByType(DependencySymbolDefinitionType type) { switch (type) { - case DependencyTupleDefinitionType.WixDependency: - return DependencyTupleDefinitions.WixDependency; + case DependencySymbolDefinitionType.WixDependency: + return DependencySymbolDefinitions.WixDependency; - case DependencyTupleDefinitionType.WixDependencyRef: - return DependencyTupleDefinitions.WixDependencyRef; + case DependencySymbolDefinitionType.WixDependencyRef: + return DependencySymbolDefinitions.WixDependencyRef; default: throw new ArgumentOutOfRangeException(nameof(type)); diff --git a/src/wixext/Tuples/WixDependencyRefTuple.cs b/src/wixext/Tuples/WixDependencyRefTuple.cs index 9b5a5eed..6f2aaadf 100644 --- a/src/wixext/Tuples/WixDependencyRefTuple.cs +++ b/src/wixext/Tuples/WixDependencyRefTuple.cs @@ -3,53 +3,53 @@ namespace WixToolset.Dependency { using WixToolset.Data; - using WixToolset.Dependency.Tuples; + using WixToolset.Dependency.Symbols; - public static partial class DependencyTupleDefinitions + public static partial class DependencySymbolDefinitions { - public static readonly IntermediateTupleDefinition WixDependencyRef = new IntermediateTupleDefinition( - DependencyTupleDefinitionType.WixDependencyRef.ToString(), + public static readonly IntermediateSymbolDefinition WixDependencyRef = new IntermediateSymbolDefinition( + DependencySymbolDefinitionType.WixDependencyRef.ToString(), new[] { - new IntermediateFieldDefinition(nameof(WixDependencyRefTupleFields.WixDependencyProviderRef), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixDependencyRefTupleFields.WixDependencyRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixDependencyRefSymbolFields.WixDependencyProviderRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixDependencyRefSymbolFields.WixDependencyRef), IntermediateFieldType.String), }, - typeof(WixDependencyRefTuple)); + typeof(WixDependencyRefSymbol)); } } -namespace WixToolset.Dependency.Tuples +namespace WixToolset.Dependency.Symbols { using WixToolset.Data; - public enum WixDependencyRefTupleFields + public enum WixDependencyRefSymbolFields { WixDependencyProviderRef, WixDependencyRef, } - public class WixDependencyRefTuple : IntermediateTuple + public class WixDependencyRefSymbol : IntermediateSymbol { - public WixDependencyRefTuple() : base(DependencyTupleDefinitions.WixDependencyRef, null, null) + public WixDependencyRefSymbol() : base(DependencySymbolDefinitions.WixDependencyRef, null, null) { } - public WixDependencyRefTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DependencyTupleDefinitions.WixDependencyRef, sourceLineNumber, id) + public WixDependencyRefSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DependencySymbolDefinitions.WixDependencyRef, sourceLineNumber, id) { } - public IntermediateField this[WixDependencyRefTupleFields index] => this.Fields[(int)index]; + public IntermediateField this[WixDependencyRefSymbolFields index] => this.Fields[(int)index]; public string WixDependencyProviderRef { - get => this.Fields[(int)WixDependencyRefTupleFields.WixDependencyProviderRef].AsString(); - set => this.Set((int)WixDependencyRefTupleFields.WixDependencyProviderRef, value); + get => this.Fields[(int)WixDependencyRefSymbolFields.WixDependencyProviderRef].AsString(); + set => this.Set((int)WixDependencyRefSymbolFields.WixDependencyProviderRef, value); } public string WixDependencyRef { - get => this.Fields[(int)WixDependencyRefTupleFields.WixDependencyRef].AsString(); - set => this.Set((int)WixDependencyRefTupleFields.WixDependencyRef, value); + get => this.Fields[(int)WixDependencyRefSymbolFields.WixDependencyRef].AsString(); + set => this.Set((int)WixDependencyRefSymbolFields.WixDependencyRef, value); } } } \ No newline at end of file diff --git a/src/wixext/Tuples/WixDependencyTuple.cs b/src/wixext/Tuples/WixDependencyTuple.cs index 1d62ae58..17c631c5 100644 --- a/src/wixext/Tuples/WixDependencyTuple.cs +++ b/src/wixext/Tuples/WixDependencyTuple.cs @@ -3,28 +3,28 @@ namespace WixToolset.Dependency { using WixToolset.Data; - using WixToolset.Dependency.Tuples; + using WixToolset.Dependency.Symbols; - public static partial class DependencyTupleDefinitions + public static partial class DependencySymbolDefinitions { - public static readonly IntermediateTupleDefinition WixDependency = new IntermediateTupleDefinition( - DependencyTupleDefinitionType.WixDependency.ToString(), + public static readonly IntermediateSymbolDefinition WixDependency = new IntermediateSymbolDefinition( + DependencySymbolDefinitionType.WixDependency.ToString(), new[] { - new IntermediateFieldDefinition(nameof(WixDependencyTupleFields.ProviderKey), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixDependencyTupleFields.MinVersion), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixDependencyTupleFields.MaxVersion), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixDependencyTupleFields.Attributes), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(WixDependencySymbolFields.ProviderKey), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixDependencySymbolFields.MinVersion), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixDependencySymbolFields.MaxVersion), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixDependencySymbolFields.Attributes), IntermediateFieldType.Number), }, - typeof(WixDependencyTuple)); + typeof(WixDependencySymbol)); } } -namespace WixToolset.Dependency.Tuples +namespace WixToolset.Dependency.Symbols { using WixToolset.Data; - public enum WixDependencyTupleFields + public enum WixDependencySymbolFields { ProviderKey, MinVersion, @@ -32,40 +32,40 @@ namespace WixToolset.Dependency.Tuples Attributes, } - public class WixDependencyTuple : IntermediateTuple + public class WixDependencySymbol : IntermediateSymbol { - public WixDependencyTuple() : base(DependencyTupleDefinitions.WixDependency, null, null) + public WixDependencySymbol() : base(DependencySymbolDefinitions.WixDependency, null, null) { } - public WixDependencyTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DependencyTupleDefinitions.WixDependency, sourceLineNumber, id) + public WixDependencySymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DependencySymbolDefinitions.WixDependency, sourceLineNumber, id) { } - public IntermediateField this[WixDependencyTupleFields index] => this.Fields[(int)index]; + public IntermediateField this[WixDependencySymbolFields index] => this.Fields[(int)index]; public string ProviderKey { - get => this.Fields[(int)WixDependencyTupleFields.ProviderKey].AsString(); - set => this.Set((int)WixDependencyTupleFields.ProviderKey, value); + get => this.Fields[(int)WixDependencySymbolFields.ProviderKey].AsString(); + set => this.Set((int)WixDependencySymbolFields.ProviderKey, value); } public string MinVersion { - get => this.Fields[(int)WixDependencyTupleFields.MinVersion].AsString(); - set => this.Set((int)WixDependencyTupleFields.MinVersion, value); + get => this.Fields[(int)WixDependencySymbolFields.MinVersion].AsString(); + set => this.Set((int)WixDependencySymbolFields.MinVersion, value); } public string MaxVersion { - get => this.Fields[(int)WixDependencyTupleFields.MaxVersion].AsString(); - set => this.Set((int)WixDependencyTupleFields.MaxVersion, value); + get => this.Fields[(int)WixDependencySymbolFields.MaxVersion].AsString(); + set => this.Set((int)WixDependencySymbolFields.MaxVersion, value); } public int Attributes { - get => this.Fields[(int)WixDependencyTupleFields.Attributes].AsNumber(); - set => this.Set((int)WixDependencyTupleFields.Attributes, value); + get => this.Fields[(int)WixDependencySymbolFields.Attributes].AsNumber(); + set => this.Set((int)WixDependencySymbolFields.Attributes, value); } } } \ No newline at end of file -- cgit v1.2.3-55-g6feb