| 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 Icon = new IntermediateSymbolDefinition( |
| 10 | SymbolDefinitionType.Icon, |
| 11 | new[] |
| 12 | { |
| 13 | new IntermediateFieldDefinition(nameof(IconSymbolFields.Data), IntermediateFieldType.Path), |
| 14 | }, |
| 15 | typeof(IconSymbol)); |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | namespace WixToolset.Data.Symbols |
| 20 | { |
| 21 | public enum IconSymbolFields |
| 22 | { |
| 23 | Data, |
| 24 | } |
| 25 | |
| 26 | public class IconSymbol : IntermediateSymbol |
| 27 | { |
| 28 | public IconSymbol() : base(SymbolDefinitions.Icon, null, null) |
| 29 | { |
| 30 | } |
| 31 | |
| 32 | public IconSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.Icon, sourceLineNumber, id) |
| 33 | { |
| 34 | } |
| 35 | |
| 36 | public IntermediateField this[IconSymbolFields index] => this.Fields[(int)index]; |
| 37 | |
| 38 | public IntermediateFieldPathValue Data |
| 39 | { |
| 40 | get => this.Fields[(int)IconSymbolFields.Data].AsPath(); |
| 41 | set => this.Set((int)IconSymbolFields.Data, value); |
| 42 | } |
| 43 | } |
| 44 | } |