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