From 5756dd94e2a1bdc4ed6b7d957c7df314b66efcd8 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 27 Jun 2020 02:51:42 -0700 Subject: The Great Tuple to Symbol File Rename (tm) --- src/wixext/Symbols/DependencySymbolDefinitions.cs | 43 ++++++++++++++ src/wixext/Symbols/WixDependencyRefSymbol.cs | 55 ++++++++++++++++++ src/wixext/Symbols/WixDependencySymbol.cs | 71 +++++++++++++++++++++++ src/wixext/Tuples/DependencyTupleDefinitions.cs | 43 -------------- src/wixext/Tuples/WixDependencyRefTuple.cs | 55 ------------------ src/wixext/Tuples/WixDependencyTuple.cs | 71 ----------------------- 6 files changed, 169 insertions(+), 169 deletions(-) create mode 100644 src/wixext/Symbols/DependencySymbolDefinitions.cs create mode 100644 src/wixext/Symbols/WixDependencyRefSymbol.cs create mode 100644 src/wixext/Symbols/WixDependencySymbol.cs delete mode 100644 src/wixext/Tuples/DependencyTupleDefinitions.cs delete mode 100644 src/wixext/Tuples/WixDependencyRefTuple.cs delete mode 100644 src/wixext/Tuples/WixDependencyTuple.cs (limited to 'src') diff --git a/src/wixext/Symbols/DependencySymbolDefinitions.cs b/src/wixext/Symbols/DependencySymbolDefinitions.cs new file mode 100644 index 00000000..5a18ae4b --- /dev/null +++ b/src/wixext/Symbols/DependencySymbolDefinitions.cs @@ -0,0 +1,43 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Dependency +{ + using System; + using WixToolset.Data; + + public enum DependencySymbolDefinitionType + { + WixDependency, + WixDependencyRef, + } + + public static partial class DependencySymbolDefinitions + { + public static readonly Version Version = new Version("4.0.0"); + + public static IntermediateSymbolDefinition ByName(string name) + { + if (!Enum.TryParse(name, out DependencySymbolDefinitionType type)) + { + return null; + } + + return ByType(type); + } + + public static IntermediateSymbolDefinition ByType(DependencySymbolDefinitionType type) + { + switch (type) + { + case DependencySymbolDefinitionType.WixDependency: + return DependencySymbolDefinitions.WixDependency; + + case DependencySymbolDefinitionType.WixDependencyRef: + return DependencySymbolDefinitions.WixDependencyRef; + + default: + throw new ArgumentOutOfRangeException(nameof(type)); + } + } + } +} diff --git a/src/wixext/Symbols/WixDependencyRefSymbol.cs b/src/wixext/Symbols/WixDependencyRefSymbol.cs new file mode 100644 index 00000000..6f2aaadf --- /dev/null +++ b/src/wixext/Symbols/WixDependencyRefSymbol.cs @@ -0,0 +1,55 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Dependency +{ + using WixToolset.Data; + using WixToolset.Dependency.Symbols; + + public static partial class DependencySymbolDefinitions + { + public static readonly IntermediateSymbolDefinition WixDependencyRef = new IntermediateSymbolDefinition( + DependencySymbolDefinitionType.WixDependencyRef.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(WixDependencyRefSymbolFields.WixDependencyProviderRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixDependencyRefSymbolFields.WixDependencyRef), IntermediateFieldType.String), + }, + typeof(WixDependencyRefSymbol)); + } +} + +namespace WixToolset.Dependency.Symbols +{ + using WixToolset.Data; + + public enum WixDependencyRefSymbolFields + { + WixDependencyProviderRef, + WixDependencyRef, + } + + public class WixDependencyRefSymbol : IntermediateSymbol + { + public WixDependencyRefSymbol() : base(DependencySymbolDefinitions.WixDependencyRef, null, null) + { + } + + public WixDependencyRefSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DependencySymbolDefinitions.WixDependencyRef, sourceLineNumber, id) + { + } + + public IntermediateField this[WixDependencyRefSymbolFields index] => this.Fields[(int)index]; + + public string WixDependencyProviderRef + { + get => this.Fields[(int)WixDependencyRefSymbolFields.WixDependencyProviderRef].AsString(); + set => this.Set((int)WixDependencyRefSymbolFields.WixDependencyProviderRef, value); + } + + public string WixDependencyRef + { + 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/Symbols/WixDependencySymbol.cs b/src/wixext/Symbols/WixDependencySymbol.cs new file mode 100644 index 00000000..17c631c5 --- /dev/null +++ b/src/wixext/Symbols/WixDependencySymbol.cs @@ -0,0 +1,71 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Dependency +{ + using WixToolset.Data; + using WixToolset.Dependency.Symbols; + + public static partial class DependencySymbolDefinitions + { + public static readonly IntermediateSymbolDefinition WixDependency = new IntermediateSymbolDefinition( + DependencySymbolDefinitionType.WixDependency.ToString(), + new[] + { + 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(WixDependencySymbol)); + } +} + +namespace WixToolset.Dependency.Symbols +{ + using WixToolset.Data; + + public enum WixDependencySymbolFields + { + ProviderKey, + MinVersion, + MaxVersion, + Attributes, + } + + public class WixDependencySymbol : IntermediateSymbol + { + public WixDependencySymbol() : base(DependencySymbolDefinitions.WixDependency, null, null) + { + } + + public WixDependencySymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DependencySymbolDefinitions.WixDependency, sourceLineNumber, id) + { + } + + public IntermediateField this[WixDependencySymbolFields index] => this.Fields[(int)index]; + + public string ProviderKey + { + get => this.Fields[(int)WixDependencySymbolFields.ProviderKey].AsString(); + set => this.Set((int)WixDependencySymbolFields.ProviderKey, value); + } + + public string MinVersion + { + get => this.Fields[(int)WixDependencySymbolFields.MinVersion].AsString(); + set => this.Set((int)WixDependencySymbolFields.MinVersion, value); + } + + public string MaxVersion + { + get => this.Fields[(int)WixDependencySymbolFields.MaxVersion].AsString(); + set => this.Set((int)WixDependencySymbolFields.MaxVersion, value); + } + + public int Attributes + { + get => this.Fields[(int)WixDependencySymbolFields.Attributes].AsNumber(); + set => this.Set((int)WixDependencySymbolFields.Attributes, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/DependencyTupleDefinitions.cs b/src/wixext/Tuples/DependencyTupleDefinitions.cs deleted file mode 100644 index 5a18ae4b..00000000 --- a/src/wixext/Tuples/DependencyTupleDefinitions.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Dependency -{ - using System; - using WixToolset.Data; - - public enum DependencySymbolDefinitionType - { - WixDependency, - WixDependencyRef, - } - - public static partial class DependencySymbolDefinitions - { - public static readonly Version Version = new Version("4.0.0"); - - public static IntermediateSymbolDefinition ByName(string name) - { - if (!Enum.TryParse(name, out DependencySymbolDefinitionType type)) - { - return null; - } - - return ByType(type); - } - - public static IntermediateSymbolDefinition ByType(DependencySymbolDefinitionType type) - { - switch (type) - { - case DependencySymbolDefinitionType.WixDependency: - return DependencySymbolDefinitions.WixDependency; - - 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 deleted file mode 100644 index 6f2aaadf..00000000 --- a/src/wixext/Tuples/WixDependencyRefTuple.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Dependency -{ - using WixToolset.Data; - using WixToolset.Dependency.Symbols; - - public static partial class DependencySymbolDefinitions - { - public static readonly IntermediateSymbolDefinition WixDependencyRef = new IntermediateSymbolDefinition( - DependencySymbolDefinitionType.WixDependencyRef.ToString(), - new[] - { - new IntermediateFieldDefinition(nameof(WixDependencyRefSymbolFields.WixDependencyProviderRef), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixDependencyRefSymbolFields.WixDependencyRef), IntermediateFieldType.String), - }, - typeof(WixDependencyRefSymbol)); - } -} - -namespace WixToolset.Dependency.Symbols -{ - using WixToolset.Data; - - public enum WixDependencyRefSymbolFields - { - WixDependencyProviderRef, - WixDependencyRef, - } - - public class WixDependencyRefSymbol : IntermediateSymbol - { - public WixDependencyRefSymbol() : base(DependencySymbolDefinitions.WixDependencyRef, null, null) - { - } - - public WixDependencyRefSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DependencySymbolDefinitions.WixDependencyRef, sourceLineNumber, id) - { - } - - public IntermediateField this[WixDependencyRefSymbolFields index] => this.Fields[(int)index]; - - public string WixDependencyProviderRef - { - get => this.Fields[(int)WixDependencyRefSymbolFields.WixDependencyProviderRef].AsString(); - set => this.Set((int)WixDependencyRefSymbolFields.WixDependencyProviderRef, value); - } - - public string WixDependencyRef - { - 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 deleted file mode 100644 index 17c631c5..00000000 --- a/src/wixext/Tuples/WixDependencyTuple.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Dependency -{ - using WixToolset.Data; - using WixToolset.Dependency.Symbols; - - public static partial class DependencySymbolDefinitions - { - public static readonly IntermediateSymbolDefinition WixDependency = new IntermediateSymbolDefinition( - DependencySymbolDefinitionType.WixDependency.ToString(), - new[] - { - 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(WixDependencySymbol)); - } -} - -namespace WixToolset.Dependency.Symbols -{ - using WixToolset.Data; - - public enum WixDependencySymbolFields - { - ProviderKey, - MinVersion, - MaxVersion, - Attributes, - } - - public class WixDependencySymbol : IntermediateSymbol - { - public WixDependencySymbol() : base(DependencySymbolDefinitions.WixDependency, null, null) - { - } - - public WixDependencySymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DependencySymbolDefinitions.WixDependency, sourceLineNumber, id) - { - } - - public IntermediateField this[WixDependencySymbolFields index] => this.Fields[(int)index]; - - public string ProviderKey - { - get => this.Fields[(int)WixDependencySymbolFields.ProviderKey].AsString(); - set => this.Set((int)WixDependencySymbolFields.ProviderKey, value); - } - - public string MinVersion - { - get => this.Fields[(int)WixDependencySymbolFields.MinVersion].AsString(); - set => this.Set((int)WixDependencySymbolFields.MinVersion, value); - } - - public string MaxVersion - { - get => this.Fields[(int)WixDependencySymbolFields.MaxVersion].AsString(); - set => this.Set((int)WixDependencySymbolFields.MaxVersion, value); - } - - public int Attributes - { - 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