| 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 Signature = new IntermediateSymbolDefinition( |
| 10 | SymbolDefinitionType.Signature, |
| 11 | new[] |
| 12 | { |
| 13 | new IntermediateFieldDefinition(nameof(SignatureSymbolFields.FileName), IntermediateFieldType.String), |
| 14 | new IntermediateFieldDefinition(nameof(SignatureSymbolFields.MinVersion), IntermediateFieldType.String), |
| 15 | new IntermediateFieldDefinition(nameof(SignatureSymbolFields.MaxVersion), IntermediateFieldType.String), |
| 16 | new IntermediateFieldDefinition(nameof(SignatureSymbolFields.MinSize), IntermediateFieldType.Number), |
| 17 | new IntermediateFieldDefinition(nameof(SignatureSymbolFields.MaxSize), IntermediateFieldType.Number), |
| 18 | new IntermediateFieldDefinition(nameof(SignatureSymbolFields.MinDate), IntermediateFieldType.Number), |
| 19 | new IntermediateFieldDefinition(nameof(SignatureSymbolFields.MaxDate), IntermediateFieldType.Number), |
| 20 | new IntermediateFieldDefinition(nameof(SignatureSymbolFields.Languages), IntermediateFieldType.String), |
| 21 | }, |
| 22 | typeof(SignatureSymbol)); |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | namespace WixToolset.Data.Symbols |
| 27 | { |
| 28 | public enum SignatureSymbolFields |
| 29 | { |
| 30 | FileName, |
| 31 | MinVersion, |
| 32 | MaxVersion, |
| 33 | MinSize, |
| 34 | MaxSize, |
| 35 | MinDate, |
| 36 | MaxDate, |
| 37 | Languages, |
| 38 | } |
| 39 | |
| 40 | public class SignatureSymbol : IntermediateSymbol |
| 41 | { |
| 42 | public SignatureSymbol() : base(SymbolDefinitions.Signature, null, null) |
| 43 | { |
| 44 | } |
| 45 | |
| 46 | public SignatureSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.Signature, sourceLineNumber, id) |
| 47 | { |
| 48 | } |
| 49 | |
| 50 | public IntermediateField this[SignatureSymbolFields index] => this.Fields[(int)index]; |
| 51 | |
| 52 | public string FileName |
| 53 | { |
| 54 | get => (string)this.Fields[(int)SignatureSymbolFields.FileName]; |
| 55 | set => this.Set((int)SignatureSymbolFields.FileName, value); |
| 56 | } |
| 57 | |
| 58 | public string MinVersion |
| 59 | { |
| 60 | get => (string)this.Fields[(int)SignatureSymbolFields.MinVersion]; |
| 61 | set => this.Set((int)SignatureSymbolFields.MinVersion, value); |
| 62 | } |
| 63 | |
| 64 | public string MaxVersion |
| 65 | { |
| 66 | get => (string)this.Fields[(int)SignatureSymbolFields.MaxVersion]; |
| 67 | set => this.Set((int)SignatureSymbolFields.MaxVersion, value); |
| 68 | } |
| 69 | |
| 70 | public int? MinSize |
| 71 | { |
| 72 | get => (int?)this.Fields[(int)SignatureSymbolFields.MinSize]; |
| 73 | set => this.Set((int)SignatureSymbolFields.MinSize, value); |
| 74 | } |
| 75 | |
| 76 | public int? MaxSize |
| 77 | { |
| 78 | get => (int?)this.Fields[(int)SignatureSymbolFields.MaxSize]; |
| 79 | set => this.Set((int)SignatureSymbolFields.MaxSize, value); |
| 80 | } |
| 81 | |
| 82 | public int? MinDate |
| 83 | { |
| 84 | get => (int?)this.Fields[(int)SignatureSymbolFields.MinDate]; |
| 85 | set => this.Set((int)SignatureSymbolFields.MinDate, value); |
| 86 | } |
| 87 | |
| 88 | public int? MaxDate |
| 89 | { |
| 90 | get => (int?)this.Fields[(int)SignatureSymbolFields.MaxDate]; |
| 91 | set => this.Set((int)SignatureSymbolFields.MaxDate, value); |
| 92 | } |
| 93 | |
| 94 | public string Languages |
| 95 | { |
| 96 | get => (string)this.Fields[(int)SignatureSymbolFields.Languages]; |
| 97 | set => this.Set((int)SignatureSymbolFields.Languages, value); |
| 98 | } |
| 99 | } |
| 100 | } |