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