| 1 | // 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. |
| 2 | |
| 3 | namespace WixToolset.Iis |
| 4 | { |
| 5 | using WixToolset.Data; |
| 6 | using WixToolset.Iis.Symbols; |
| 7 | |
| 8 | public static partial class IisSymbolDefinitions |
| 9 | { |
| 10 | public static readonly IntermediateSymbolDefinition IIsWebError = new IntermediateSymbolDefinition( |
| 11 | IisSymbolDefinitionType.IIsWebError.ToString(), |
| 12 | new[] |
| 13 | { |
| 14 | new IntermediateFieldDefinition(nameof(IIsWebErrorSymbolFields.ErrorCode), IntermediateFieldType.Number), |
| 15 | new IntermediateFieldDefinition(nameof(IIsWebErrorSymbolFields.SubCode), IntermediateFieldType.Number), |
| 16 | new IntermediateFieldDefinition(nameof(IIsWebErrorSymbolFields.ParentType), IntermediateFieldType.Number), |
| 17 | new IntermediateFieldDefinition(nameof(IIsWebErrorSymbolFields.ParentValue), IntermediateFieldType.String), |
| 18 | new IntermediateFieldDefinition(nameof(IIsWebErrorSymbolFields.File), IntermediateFieldType.String), |
| 19 | new IntermediateFieldDefinition(nameof(IIsWebErrorSymbolFields.URL), IntermediateFieldType.String), |
| 20 | }, |
| 21 | typeof(IIsWebErrorSymbol)); |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | namespace WixToolset.Iis.Symbols |
| 26 | { |
| 27 | using WixToolset.Data; |
| 28 | |
| 29 | public enum IIsWebErrorSymbolFields |
| 30 | { |
| 31 | ErrorCode, |
| 32 | SubCode, |
| 33 | ParentType, |
| 34 | ParentValue, |
| 35 | File, |
| 36 | URL, |
| 37 | } |
| 38 | |
| 39 | public class IIsWebErrorSymbol : IntermediateSymbol |
| 40 | { |
| 41 | public IIsWebErrorSymbol() : base(IisSymbolDefinitions.IIsWebError, null, null) |
| 42 | { |
| 43 | } |
| 44 | |
| 45 | public IIsWebErrorSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisSymbolDefinitions.IIsWebError, sourceLineNumber, id) |
| 46 | { |
| 47 | } |
| 48 | |
| 49 | public IntermediateField this[IIsWebErrorSymbolFields index] => this.Fields[(int)index]; |
| 50 | |
| 51 | public int ErrorCode |
| 52 | { |
| 53 | get => this.Fields[(int)IIsWebErrorSymbolFields.ErrorCode].AsNumber(); |
| 54 | set => this.Set((int)IIsWebErrorSymbolFields.ErrorCode, value); |
| 55 | } |
| 56 | |
| 57 | public int SubCode |
| 58 | { |
| 59 | get => this.Fields[(int)IIsWebErrorSymbolFields.SubCode].AsNumber(); |
| 60 | set => this.Set((int)IIsWebErrorSymbolFields.SubCode, value); |
| 61 | } |
| 62 | |
| 63 | public int ParentType |
| 64 | { |
| 65 | get => this.Fields[(int)IIsWebErrorSymbolFields.ParentType].AsNumber(); |
| 66 | set => this.Set((int)IIsWebErrorSymbolFields.ParentType, value); |
| 67 | } |
| 68 | |
| 69 | public string ParentValue |
| 70 | { |
| 71 | get => this.Fields[(int)IIsWebErrorSymbolFields.ParentValue].AsString(); |
| 72 | set => this.Set((int)IIsWebErrorSymbolFields.ParentValue, value); |
| 73 | } |
| 74 | |
| 75 | public string File |
| 76 | { |
| 77 | get => this.Fields[(int)IIsWebErrorSymbolFields.File].AsString(); |
| 78 | set => this.Set((int)IIsWebErrorSymbolFields.File, value); |
| 79 | } |
| 80 | |
| 81 | public string URL |
| 82 | { |
| 83 | get => this.Fields[(int)IIsWebErrorSymbolFields.URL].AsString(); |
| 84 | set => this.Set((int)IIsWebErrorSymbolFields.URL, value); |
| 85 | } |
| 86 | } |
| 87 | } |