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