| 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 IIsMimeMap = new IntermediateSymbolDefinition( |
| 11 | IisSymbolDefinitionType.IIsMimeMap.ToString(), |
| 12 | new[] |
| 13 | { |
| 14 | new IntermediateFieldDefinition(nameof(IIsMimeMapSymbolFields.ParentType), IntermediateFieldType.Number), |
| 15 | new IntermediateFieldDefinition(nameof(IIsMimeMapSymbolFields.ParentValue), IntermediateFieldType.String), |
| 16 | new IntermediateFieldDefinition(nameof(IIsMimeMapSymbolFields.MimeType), IntermediateFieldType.String), |
| 17 | new IntermediateFieldDefinition(nameof(IIsMimeMapSymbolFields.Extension), IntermediateFieldType.String), |
| 18 | }, |
| 19 | typeof(IIsMimeMapSymbol)); |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | namespace WixToolset.Iis.Symbols |
| 24 | { |
| 25 | using WixToolset.Data; |
| 26 | |
| 27 | public enum IIsMimeMapSymbolFields |
| 28 | { |
| 29 | ParentType, |
| 30 | ParentValue, |
| 31 | MimeType, |
| 32 | Extension, |
| 33 | } |
| 34 | |
| 35 | public class IIsMimeMapSymbol : IntermediateSymbol |
| 36 | { |
| 37 | public IIsMimeMapSymbol() : base(IisSymbolDefinitions.IIsMimeMap, null, null) |
| 38 | { |
| 39 | } |
| 40 | |
| 41 | public IIsMimeMapSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisSymbolDefinitions.IIsMimeMap, sourceLineNumber, id) |
| 42 | { |
| 43 | } |
| 44 | |
| 45 | public IntermediateField this[IIsMimeMapSymbolFields index] => this.Fields[(int)index]; |
| 46 | |
| 47 | public int ParentType |
| 48 | { |
| 49 | get => this.Fields[(int)IIsMimeMapSymbolFields.ParentType].AsNumber(); |
| 50 | set => this.Set((int)IIsMimeMapSymbolFields.ParentType, value); |
| 51 | } |
| 52 | |
| 53 | public string ParentValue |
| 54 | { |
| 55 | get => this.Fields[(int)IIsMimeMapSymbolFields.ParentValue].AsString(); |
| 56 | set => this.Set((int)IIsMimeMapSymbolFields.ParentValue, value); |
| 57 | } |
| 58 | |
| 59 | public string MimeType |
| 60 | { |
| 61 | get => this.Fields[(int)IIsMimeMapSymbolFields.MimeType].AsString(); |
| 62 | set => this.Set((int)IIsMimeMapSymbolFields.MimeType, value); |
| 63 | } |
| 64 | |
| 65 | public string Extension |
| 66 | { |
| 67 | get => this.Fields[(int)IIsMimeMapSymbolFields.Extension].AsString(); |
| 68 | set => this.Set((int)IIsMimeMapSymbolFields.Extension, value); |
| 69 | } |
| 70 | } |
| 71 | } |