main
cs 96 lines 3.49 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 Assembly = new IntermediateSymbolDefinition(
10 SymbolDefinitionType.Assembly,
11 new[]
12 {
13 new IntermediateFieldDefinition(nameof(AssemblySymbolFields.ComponentRef), IntermediateFieldType.String),
14 new IntermediateFieldDefinition(nameof(AssemblySymbolFields.FeatureRef), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(AssemblySymbolFields.ManifestFileRef), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(AssemblySymbolFields.ApplicationFileRef), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(AssemblySymbolFields.Type), IntermediateFieldType.Number),
18 new IntermediateFieldDefinition(nameof(AssemblySymbolFields.ProcessorArchitecture), IntermediateFieldType.String),
19 },
20 typeof(AssemblySymbol));
21 }
22 }
23
24 namespace WixToolset.Data.Symbols
25 {
26 public enum AssemblySymbolFields
27 {
28 ComponentRef,
29 FeatureRef,
30 ManifestFileRef,
31 ApplicationFileRef,
32 Type,
33 ProcessorArchitecture,
34 }
35
36 public enum AssemblyType
37 {
38 /// <summary>File is not an assembly.</summary>
39 NotAnAssembly,
40
41 /// <summary>File is a Common Language Runtime Assembly.</summary>
42 DotNetAssembly,
43
44 /// <summary>File is Win32 SxS assembly.</summary>
45 Win32Assembly,
46 }
47
48 public class AssemblySymbol : IntermediateSymbol
49 {
50 public AssemblySymbol() : base(SymbolDefinitions.Assembly, null, null)
51 {
52 }
53
54 public AssemblySymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.Assembly, sourceLineNumber, id)
55 {
56 }
57
58 public IntermediateField this[AssemblySymbolFields index] => this.Fields[(int)index];
59
60 public string ComponentRef
61 {
62 get => (string)this.Fields[(int)AssemblySymbolFields.ComponentRef];
63 set => this.Set((int)AssemblySymbolFields.ComponentRef, value);
64 }
65
66 public string FeatureRef
67 {
68 get => (string)this.Fields[(int)AssemblySymbolFields.FeatureRef];
69 set => this.Set((int)AssemblySymbolFields.FeatureRef, value);
70 }
71
72 public string ManifestFileRef
73 {
74 get => (string)this.Fields[(int)AssemblySymbolFields.ManifestFileRef];
75 set => this.Set((int)AssemblySymbolFields.ManifestFileRef, value);
76 }
77
78 public string ApplicationFileRef
79 {
80 get => (string)this.Fields[(int)AssemblySymbolFields.ApplicationFileRef];
81 set => this.Set((int)AssemblySymbolFields.ApplicationFileRef, value);
82 }
83
84 public AssemblyType Type
85 {
86 get => (AssemblyType)this.Fields[(int)AssemblySymbolFields.Type].AsNumber();
87 set => this.Set((int)AssemblySymbolFields.Type, (int)value);
88 }
89
90 public string ProcessorArchitecture
91 {
92 get => (string)this.Fields[(int)AssemblySymbolFields.ProcessorArchitecture];
93 set => this.Set((int)AssemblySymbolFields.ProcessorArchitecture, value);
94 }
95 }
96 }