| 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 WixDeltaPatchSymbolPaths = new IntermediateSymbolDefinition( |
| 10 | SymbolDefinitionType.WixDeltaPatchSymbolPaths, |
| 11 | new[] |
| 12 | { |
| 13 | new IntermediateFieldDefinition(nameof(WixDeltaPatchSymbolPathsSymbolFields.SymbolType), IntermediateFieldType.Number), |
| 14 | new IntermediateFieldDefinition(nameof(WixDeltaPatchSymbolPathsSymbolFields.SymbolId), IntermediateFieldType.String), |
| 15 | new IntermediateFieldDefinition(nameof(WixDeltaPatchSymbolPathsSymbolFields.SymbolPaths), IntermediateFieldType.String), |
| 16 | }, |
| 17 | typeof(WixDeltaPatchSymbolPathsSymbol)); |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | namespace WixToolset.Data.Symbols |
| 22 | { |
| 23 | public enum WixDeltaPatchSymbolPathsSymbolFields |
| 24 | { |
| 25 | SymbolType, |
| 26 | SymbolId, |
| 27 | SymbolPaths, |
| 28 | } |
| 29 | |
| 30 | /// <summary> |
| 31 | /// The types that the WixDeltaPatchSymbolPaths table can hold. |
| 32 | /// </summary> |
| 33 | /// <remarks>The order of these values is important since WixDeltaPatchSymbolPaths are sorted by this type.</remarks> |
| 34 | public enum SymbolPathType |
| 35 | { |
| 36 | File, |
| 37 | Component, |
| 38 | Directory, |
| 39 | Media, |
| 40 | Product |
| 41 | }; |
| 42 | |
| 43 | public class WixDeltaPatchSymbolPathsSymbol : IntermediateSymbol |
| 44 | { |
| 45 | public WixDeltaPatchSymbolPathsSymbol() : base(SymbolDefinitions.WixDeltaPatchSymbolPaths, null, null) |
| 46 | { |
| 47 | } |
| 48 | |
| 49 | public WixDeltaPatchSymbolPathsSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixDeltaPatchSymbolPaths, sourceLineNumber, id) |
| 50 | { |
| 51 | } |
| 52 | |
| 53 | public IntermediateField this[WixDeltaPatchSymbolPathsSymbolFields index] => this.Fields[(int)index]; |
| 54 | |
| 55 | public SymbolPathType SymbolType |
| 56 | { |
| 57 | get => (SymbolPathType)this.Fields[(int)WixDeltaPatchSymbolPathsSymbolFields.SymbolType].AsNumber(); |
| 58 | set => this.Set((int)WixDeltaPatchSymbolPathsSymbolFields.SymbolType, (int)value); |
| 59 | } |
| 60 | |
| 61 | public string SymbolId |
| 62 | { |
| 63 | get => (string)this.Fields[(int)WixDeltaPatchSymbolPathsSymbolFields.SymbolId]; |
| 64 | set => this.Set((int)WixDeltaPatchSymbolPathsSymbolFields.SymbolId, value); |
| 65 | } |
| 66 | |
| 67 | public string SymbolPaths |
| 68 | { |
| 69 | get => (string)this.Fields[(int)WixDeltaPatchSymbolPathsSymbolFields.SymbolPaths]; |
| 70 | set => this.Set((int)WixDeltaPatchSymbolPathsSymbolFields.SymbolPaths, value); |
| 71 | } |
| 72 | } |
| 73 | } |