main
cs 90 lines 3.65 KB
Raw
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 WixDependencyProvider = new IntermediateSymbolDefinition(
10 SymbolDefinitionType.WixDependencyProvider,
11 new[]
12 {
13 new IntermediateFieldDefinition(nameof(WixDependencyProviderSymbolFields.ParentRef), IntermediateFieldType.String),
14 new IntermediateFieldDefinition(nameof(WixDependencyProviderSymbolFields.ProviderKey), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(WixDependencyProviderSymbolFields.Version), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(WixDependencyProviderSymbolFields.DisplayName), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(WixDependencyProviderSymbolFields.Attributes), IntermediateFieldType.Number),
18 },
19 typeof(WixDependencyProviderSymbol));
20 }
21 }
22
23 namespace WixToolset.Data.Symbols
24 {
25 using System;
26 using WixToolset.Data;
27
28 public enum WixDependencyProviderSymbolFields
29 {
30 ParentRef,
31 ProviderKey,
32 Version,
33 DisplayName,
34 Attributes,
35 }
36
37 [Flags]
38 public enum WixDependencyProviderAttributes
39 {
40 ProvidesAttributesBundle = 0x10000,
41 ProvidesAttributesImported = 0x20000
42 }
43
44 public class WixDependencyProviderSymbol : IntermediateSymbol
45 {
46 public WixDependencyProviderSymbol() : base(SymbolDefinitions.WixDependencyProvider, null, null)
47 {
48 }
49
50 public WixDependencyProviderSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixDependencyProvider, sourceLineNumber, id)
51 {
52 }
53
54 public IntermediateField this[WixDependencyProviderSymbolFields index] => this.Fields[(int)index];
55
56 public string ParentRef
57 {
58 get => this.Fields[(int)WixDependencyProviderSymbolFields.ParentRef].AsString();
59 set => this.Set((int)WixDependencyProviderSymbolFields.ParentRef, value);
60 }
61
62 public string ProviderKey
63 {
64 get => this.Fields[(int)WixDependencyProviderSymbolFields.ProviderKey].AsString();
65 set => this.Set((int)WixDependencyProviderSymbolFields.ProviderKey, value);
66 }
67
68 public string Version
69 {
70 get => this.Fields[(int)WixDependencyProviderSymbolFields.Version].AsString();
71 set => this.Set((int)WixDependencyProviderSymbolFields.Version, value);
72 }
73
74 public string DisplayName
75 {
76 get => this.Fields[(int)WixDependencyProviderSymbolFields.DisplayName].AsString();
77 set => this.Set((int)WixDependencyProviderSymbolFields.DisplayName, value);
78 }
79
80 public WixDependencyProviderAttributes Attributes
81 {
82 get => (WixDependencyProviderAttributes)(int)this.Fields[(int)WixDependencyProviderSymbolFields.Attributes];
83 set => this.Set((int)WixDependencyProviderSymbolFields.Attributes, (int)value);
84 }
85
86 public bool Bundle => (this.Attributes & WixDependencyProviderAttributes.ProvidesAttributesBundle) == WixDependencyProviderAttributes.ProvidesAttributesBundle;
87
88 public bool Imported => (this.Attributes & WixDependencyProviderAttributes.ProvidesAttributesImported) == WixDependencyProviderAttributes.ProvidesAttributesImported;
89 }
90 }