| 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.Data |
| 4 | { |
| 5 | using WixToolset.Data.Symbols; |
| 6 | |
| 7 | public static partial class SymbolDefinitions |
| 8 | { |
| 9 | public static readonly IntermediateSymbolDefinition IniLocator = new IntermediateSymbolDefinition( |
| 10 | SymbolDefinitionType.IniLocator, |
| 11 | new[] |
| 12 | { |
| 13 | new IntermediateFieldDefinition(nameof(IniLocatorSymbolFields.FileName), IntermediateFieldType.String), |
| 14 | new IntermediateFieldDefinition(nameof(IniLocatorSymbolFields.ShortFileName), IntermediateFieldType.String), |
| 15 | new IntermediateFieldDefinition(nameof(IniLocatorSymbolFields.Section), IntermediateFieldType.String), |
| 16 | new IntermediateFieldDefinition(nameof(IniLocatorSymbolFields.Key), IntermediateFieldType.String), |
| 17 | new IntermediateFieldDefinition(nameof(IniLocatorSymbolFields.Field), IntermediateFieldType.Number), |
| 18 | new IntermediateFieldDefinition(nameof(IniLocatorSymbolFields.Type), IntermediateFieldType.Number), |
| 19 | }, |
| 20 | typeof(IniLocatorSymbol)); |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | namespace WixToolset.Data.Symbols |
| 25 | { |
| 26 | public enum IniLocatorSymbolFields |
| 27 | { |
| 28 | FileName, |
| 29 | ShortFileName, |
| 30 | Section, |
| 31 | Key, |
| 32 | Field, |
| 33 | Type, |
| 34 | } |
| 35 | |
| 36 | public class IniLocatorSymbol : IntermediateSymbol |
| 37 | { |
| 38 | public IniLocatorSymbol() : base(SymbolDefinitions.IniLocator, null, null) |
| 39 | { |
| 40 | } |
| 41 | |
| 42 | public IniLocatorSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.IniLocator, sourceLineNumber, id) |
| 43 | { |
| 44 | } |
| 45 | |
| 46 | public IntermediateField this[IniLocatorSymbolFields index] => this.Fields[(int)index]; |
| 47 | |
| 48 | public string FileName |
| 49 | { |
| 50 | get => (string)this.Fields[(int)IniLocatorSymbolFields.FileName]; |
| 51 | set => this.Set((int)IniLocatorSymbolFields.FileName, value); |
| 52 | } |
| 53 | |
| 54 | public string ShortFileName |
| 55 | { |
| 56 | get => (string)this.Fields[(int)IniLocatorSymbolFields.ShortFileName]; |
| 57 | set => this.Set((int)IniLocatorSymbolFields.ShortFileName, value); |
| 58 | } |
| 59 | |
| 60 | public string Section |
| 61 | { |
| 62 | get => (string)this.Fields[(int)IniLocatorSymbolFields.Section]; |
| 63 | set => this.Set((int)IniLocatorSymbolFields.Section, value); |
| 64 | } |
| 65 | |
| 66 | public string Key |
| 67 | { |
| 68 | get => (string)this.Fields[(int)IniLocatorSymbolFields.Key]; |
| 69 | set => this.Set((int)IniLocatorSymbolFields.Key, value); |
| 70 | } |
| 71 | |
| 72 | public int? Field |
| 73 | { |
| 74 | get => (int?)this.Fields[(int)IniLocatorSymbolFields.Field]; |
| 75 | set => this.Set((int)IniLocatorSymbolFields.Field, value); |
| 76 | } |
| 77 | |
| 78 | public int? Type |
| 79 | { |
| 80 | get => (int?)this.Fields[(int)IniLocatorSymbolFields.Type]; |
| 81 | set => this.Set((int)IniLocatorSymbolFields.Type, value); |
| 82 | } |
| 83 | } |
| 84 | } |