From fb2436ef2e5ba9b5c16c7f0fdc948fc6d1faf8b5 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 25 Jun 2020 14:47:54 -0700 Subject: The Great Tuple to Symbol File Rename (tm) --- src/test/Example.Extension/ExampleSearchSymbol.cs | 30 ++++++++++ src/test/Example.Extension/ExampleSearchTuple.cs | 30 ---------- src/test/Example.Extension/ExampleSymbol.cs | 30 ++++++++++ .../Example.Extension/ExampleSymbolDefinitions.cs | 67 ++++++++++++++++++++++ src/test/Example.Extension/ExampleTuple.cs | 30 ---------- .../Example.Extension/ExampleTupleDefinitions.cs | 67 ---------------------- 6 files changed, 127 insertions(+), 127 deletions(-) create mode 100644 src/test/Example.Extension/ExampleSearchSymbol.cs delete mode 100644 src/test/Example.Extension/ExampleSearchTuple.cs create mode 100644 src/test/Example.Extension/ExampleSymbol.cs create mode 100644 src/test/Example.Extension/ExampleSymbolDefinitions.cs delete mode 100644 src/test/Example.Extension/ExampleTuple.cs delete mode 100644 src/test/Example.Extension/ExampleTupleDefinitions.cs (limited to 'src/test/Example.Extension') diff --git a/src/test/Example.Extension/ExampleSearchSymbol.cs b/src/test/Example.Extension/ExampleSearchSymbol.cs new file mode 100644 index 00000000..40a39292 --- /dev/null +++ b/src/test/Example.Extension/ExampleSearchSymbol.cs @@ -0,0 +1,30 @@ +// 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 Example.Extension +{ + using WixToolset.Data; + + public enum ExampleSearchSymbolFields + { + SearchFor, + } + + public class ExampleSearchSymbol : IntermediateSymbol + { + public ExampleSearchSymbol() : base(ExampleSymbolDefinitions.ExampleSearch, null, null) + { + } + + public ExampleSearchSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(ExampleSymbolDefinitions.ExampleSearch, sourceLineNumber, id) + { + } + + public IntermediateField this[ExampleSymbolFields index] => this.Fields[(int)index]; + + public string SearchFor + { + get => this.Fields[(int)ExampleSearchSymbolFields.SearchFor]?.AsString(); + set => this.Set((int)ExampleSearchSymbolFields.SearchFor, value); + } + } +} diff --git a/src/test/Example.Extension/ExampleSearchTuple.cs b/src/test/Example.Extension/ExampleSearchTuple.cs deleted file mode 100644 index 40a39292..00000000 --- a/src/test/Example.Extension/ExampleSearchTuple.cs +++ /dev/null @@ -1,30 +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 Example.Extension -{ - using WixToolset.Data; - - public enum ExampleSearchSymbolFields - { - SearchFor, - } - - public class ExampleSearchSymbol : IntermediateSymbol - { - public ExampleSearchSymbol() : base(ExampleSymbolDefinitions.ExampleSearch, null, null) - { - } - - public ExampleSearchSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(ExampleSymbolDefinitions.ExampleSearch, sourceLineNumber, id) - { - } - - public IntermediateField this[ExampleSymbolFields index] => this.Fields[(int)index]; - - public string SearchFor - { - get => this.Fields[(int)ExampleSearchSymbolFields.SearchFor]?.AsString(); - set => this.Set((int)ExampleSearchSymbolFields.SearchFor, value); - } - } -} diff --git a/src/test/Example.Extension/ExampleSymbol.cs b/src/test/Example.Extension/ExampleSymbol.cs new file mode 100644 index 00000000..314087e9 --- /dev/null +++ b/src/test/Example.Extension/ExampleSymbol.cs @@ -0,0 +1,30 @@ +// 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 Example.Extension +{ + using WixToolset.Data; + + public enum ExampleSymbolFields + { + Value, + } + + public class ExampleSymbol : IntermediateSymbol + { + public ExampleSymbol() : base(ExampleSymbolDefinitions.Example, null, null) + { + } + + public ExampleSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(ExampleSymbolDefinitions.Example, sourceLineNumber, id) + { + } + + public IntermediateField this[ExampleSymbolFields index] => this.Fields[(int)index]; + + public string Value + { + get => this.Fields[(int)ExampleSymbolFields.Value]?.AsString(); + set => this.Set((int)ExampleSymbolFields.Value, value); + } + } +} diff --git a/src/test/Example.Extension/ExampleSymbolDefinitions.cs b/src/test/Example.Extension/ExampleSymbolDefinitions.cs new file mode 100644 index 00000000..f13d716d --- /dev/null +++ b/src/test/Example.Extension/ExampleSymbolDefinitions.cs @@ -0,0 +1,67 @@ +// 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 Example.Extension +{ + using System; + using WixToolset.Data; + using WixToolset.Data.Burn; + + public enum ExampleSymbolDefinitionType + { + Example, + ExampleSearch, + } + + public static class ExampleSymbolDefinitions + { + public static readonly IntermediateSymbolDefinition Example = new IntermediateSymbolDefinition( + ExampleSymbolDefinitionType.Example.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(ExampleSymbolFields.Value), IntermediateFieldType.String), + }, + typeof(ExampleSymbol)); + + public static readonly IntermediateSymbolDefinition ExampleSearch = new IntermediateSymbolDefinition( + ExampleSymbolDefinitionType.ExampleSearch.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(ExampleSearchSymbolFields.SearchFor), IntermediateFieldType.String), + }, + typeof(ExampleSearchSymbol)); + + static ExampleSymbolDefinitions() + { + ExampleSearch.AddTag(BurnConstants.BundleExtensionSearchSymbolDefinitionTag); + } + + public static bool TryGetSymbolType(string name, out ExampleSymbolDefinitionType type) + { + return Enum.TryParse(name, out type); + } + + public static IntermediateSymbolDefinition ByName(string name) + { + if (!TryGetSymbolType(name, out var type)) + { + return null; + } + return ByType(type); + } + + public static IntermediateSymbolDefinition ByType(ExampleSymbolDefinitionType type) + { + switch (type) + { + case ExampleSymbolDefinitionType.Example: + return ExampleSymbolDefinitions.Example; + + case ExampleSymbolDefinitionType.ExampleSearch: + return ExampleSymbolDefinitions.ExampleSearch; + + default: + throw new ArgumentOutOfRangeException(nameof(type)); + } + } + } +} diff --git a/src/test/Example.Extension/ExampleTuple.cs b/src/test/Example.Extension/ExampleTuple.cs deleted file mode 100644 index 314087e9..00000000 --- a/src/test/Example.Extension/ExampleTuple.cs +++ /dev/null @@ -1,30 +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 Example.Extension -{ - using WixToolset.Data; - - public enum ExampleSymbolFields - { - Value, - } - - public class ExampleSymbol : IntermediateSymbol - { - public ExampleSymbol() : base(ExampleSymbolDefinitions.Example, null, null) - { - } - - public ExampleSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(ExampleSymbolDefinitions.Example, sourceLineNumber, id) - { - } - - public IntermediateField this[ExampleSymbolFields index] => this.Fields[(int)index]; - - public string Value - { - get => this.Fields[(int)ExampleSymbolFields.Value]?.AsString(); - set => this.Set((int)ExampleSymbolFields.Value, value); - } - } -} diff --git a/src/test/Example.Extension/ExampleTupleDefinitions.cs b/src/test/Example.Extension/ExampleTupleDefinitions.cs deleted file mode 100644 index f13d716d..00000000 --- a/src/test/Example.Extension/ExampleTupleDefinitions.cs +++ /dev/null @@ -1,67 +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 Example.Extension -{ - using System; - using WixToolset.Data; - using WixToolset.Data.Burn; - - public enum ExampleSymbolDefinitionType - { - Example, - ExampleSearch, - } - - public static class ExampleSymbolDefinitions - { - public static readonly IntermediateSymbolDefinition Example = new IntermediateSymbolDefinition( - ExampleSymbolDefinitionType.Example.ToString(), - new[] - { - new IntermediateFieldDefinition(nameof(ExampleSymbolFields.Value), IntermediateFieldType.String), - }, - typeof(ExampleSymbol)); - - public static readonly IntermediateSymbolDefinition ExampleSearch = new IntermediateSymbolDefinition( - ExampleSymbolDefinitionType.ExampleSearch.ToString(), - new[] - { - new IntermediateFieldDefinition(nameof(ExampleSearchSymbolFields.SearchFor), IntermediateFieldType.String), - }, - typeof(ExampleSearchSymbol)); - - static ExampleSymbolDefinitions() - { - ExampleSearch.AddTag(BurnConstants.BundleExtensionSearchSymbolDefinitionTag); - } - - public static bool TryGetSymbolType(string name, out ExampleSymbolDefinitionType type) - { - return Enum.TryParse(name, out type); - } - - public static IntermediateSymbolDefinition ByName(string name) - { - if (!TryGetSymbolType(name, out var type)) - { - return null; - } - return ByType(type); - } - - public static IntermediateSymbolDefinition ByType(ExampleSymbolDefinitionType type) - { - switch (type) - { - case ExampleSymbolDefinitionType.Example: - return ExampleSymbolDefinitions.Example; - - case ExampleSymbolDefinitionType.ExampleSearch: - return ExampleSymbolDefinitions.ExampleSearch; - - default: - throw new ArgumentOutOfRangeException(nameof(type)); - } - } - } -} -- cgit v1.2.3-55-g6feb