From bb9420d30cbcf7ad3506f92ab1c673f7f60ac03c Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 27 Jun 2020 14:35:57 -0700 Subject: The Great Tuple to Symbol File Rename (tm) --- src/wixext/Symbols/HttpSymbolDefinitions.cs | 43 ++++++++++++++ src/wixext/Symbols/WixHttpUrlAceSymbol.cs | 63 ++++++++++++++++++++ src/wixext/Symbols/WixHttpUrlReservationSymbol.cs | 71 +++++++++++++++++++++++ 3 files changed, 177 insertions(+) create mode 100644 src/wixext/Symbols/HttpSymbolDefinitions.cs create mode 100644 src/wixext/Symbols/WixHttpUrlAceSymbol.cs create mode 100644 src/wixext/Symbols/WixHttpUrlReservationSymbol.cs (limited to 'src/wixext/Symbols') diff --git a/src/wixext/Symbols/HttpSymbolDefinitions.cs b/src/wixext/Symbols/HttpSymbolDefinitions.cs new file mode 100644 index 00000000..a6deb307 --- /dev/null +++ b/src/wixext/Symbols/HttpSymbolDefinitions.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.Http +{ + using System; + using WixToolset.Data; + + public enum HttpSymbolDefinitionType + { + WixHttpUrlAce, + WixHttpUrlReservation, + } + + public static partial class HttpSymbolDefinitions + { + public static readonly Version Version = new Version("4.0.0"); + + public static IntermediateSymbolDefinition ByName(string name) + { + if (!Enum.TryParse(name, out HttpSymbolDefinitionType type)) + { + return null; + } + + return ByType(type); + } + + public static IntermediateSymbolDefinition ByType(HttpSymbolDefinitionType type) + { + switch (type) + { + case HttpSymbolDefinitionType.WixHttpUrlAce: + return HttpSymbolDefinitions.WixHttpUrlAce; + + case HttpSymbolDefinitionType.WixHttpUrlReservation: + return HttpSymbolDefinitions.WixHttpUrlReservation; + + default: + throw new ArgumentOutOfRangeException(nameof(type)); + } + } + } +} diff --git a/src/wixext/Symbols/WixHttpUrlAceSymbol.cs b/src/wixext/Symbols/WixHttpUrlAceSymbol.cs new file mode 100644 index 00000000..1d57bd52 --- /dev/null +++ b/src/wixext/Symbols/WixHttpUrlAceSymbol.cs @@ -0,0 +1,63 @@ +// 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.Http +{ + using WixToolset.Data; + using WixToolset.Http.Symbols; + + public static partial class HttpSymbolDefinitions + { + public static readonly IntermediateSymbolDefinition WixHttpUrlAce = new IntermediateSymbolDefinition( + HttpSymbolDefinitionType.WixHttpUrlAce.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(WixHttpUrlAceSymbolFields.WixHttpUrlReservationRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixHttpUrlAceSymbolFields.SecurityPrincipal), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixHttpUrlAceSymbolFields.Rights), IntermediateFieldType.Number), + }, + typeof(WixHttpUrlAceSymbol)); + } +} + +namespace WixToolset.Http.Symbols +{ + using WixToolset.Data; + + public enum WixHttpUrlAceSymbolFields + { + WixHttpUrlReservationRef, + SecurityPrincipal, + Rights, + } + + public class WixHttpUrlAceSymbol : IntermediateSymbol + { + public WixHttpUrlAceSymbol() : base(HttpSymbolDefinitions.WixHttpUrlAce, null, null) + { + } + + public WixHttpUrlAceSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(HttpSymbolDefinitions.WixHttpUrlAce, sourceLineNumber, id) + { + } + + public IntermediateField this[WixHttpUrlAceSymbolFields index] => this.Fields[(int)index]; + + public string WixHttpUrlReservationRef + { + get => this.Fields[(int)WixHttpUrlAceSymbolFields.WixHttpUrlReservationRef].AsString(); + set => this.Set((int)WixHttpUrlAceSymbolFields.WixHttpUrlReservationRef, value); + } + + public string SecurityPrincipal + { + get => this.Fields[(int)WixHttpUrlAceSymbolFields.SecurityPrincipal].AsString(); + set => this.Set((int)WixHttpUrlAceSymbolFields.SecurityPrincipal, value); + } + + public int Rights + { + get => this.Fields[(int)WixHttpUrlAceSymbolFields.Rights].AsNumber(); + set => this.Set((int)WixHttpUrlAceSymbolFields.Rights, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Symbols/WixHttpUrlReservationSymbol.cs b/src/wixext/Symbols/WixHttpUrlReservationSymbol.cs new file mode 100644 index 00000000..4bdc2fee --- /dev/null +++ b/src/wixext/Symbols/WixHttpUrlReservationSymbol.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.Http +{ + using WixToolset.Data; + using WixToolset.Http.Symbols; + + public static partial class HttpSymbolDefinitions + { + public static readonly IntermediateSymbolDefinition WixHttpUrlReservation = new IntermediateSymbolDefinition( + HttpSymbolDefinitionType.WixHttpUrlReservation.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(WixHttpUrlReservationSymbolFields.HandleExisting), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(WixHttpUrlReservationSymbolFields.Sddl), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixHttpUrlReservationSymbolFields.Url), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixHttpUrlReservationSymbolFields.ComponentRef), IntermediateFieldType.String), + }, + typeof(WixHttpUrlReservationSymbol)); + } +} + +namespace WixToolset.Http.Symbols +{ + using WixToolset.Data; + + public enum WixHttpUrlReservationSymbolFields + { + HandleExisting, + Sddl, + Url, + ComponentRef, + } + + public class WixHttpUrlReservationSymbol : IntermediateSymbol + { + public WixHttpUrlReservationSymbol() : base(HttpSymbolDefinitions.WixHttpUrlReservation, null, null) + { + } + + public WixHttpUrlReservationSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(HttpSymbolDefinitions.WixHttpUrlReservation, sourceLineNumber, id) + { + } + + public IntermediateField this[WixHttpUrlReservationSymbolFields index] => this.Fields[(int)index]; + + public int HandleExisting + { + get => this.Fields[(int)WixHttpUrlReservationSymbolFields.HandleExisting].AsNumber(); + set => this.Set((int)WixHttpUrlReservationSymbolFields.HandleExisting, value); + } + + public string Sddl + { + get => this.Fields[(int)WixHttpUrlReservationSymbolFields.Sddl].AsString(); + set => this.Set((int)WixHttpUrlReservationSymbolFields.Sddl, value); + } + + public string Url + { + get => this.Fields[(int)WixHttpUrlReservationSymbolFields.Url].AsString(); + set => this.Set((int)WixHttpUrlReservationSymbolFields.Url, value); + } + + public string ComponentRef + { + get => this.Fields[(int)WixHttpUrlReservationSymbolFields.ComponentRef].AsString(); + set => this.Set((int)WixHttpUrlReservationSymbolFields.ComponentRef, value); + } + } +} \ No newline at end of file -- cgit v1.2.3-55-g6feb