aboutsummaryrefslogtreecommitdiff
path: root/src/wixext/Symbols
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2020-06-27 12:08:02 -0700
committerRob Mensching <rob@firegiant.com>2020-06-27 13:30:34 -0700
commita790cb2da9600562e2622eb074274b0d69257484 (patch)
tree024ff5b41c6e42d979f3810414311aa85a37a2ed /src/wixext/Symbols
parent8e0423b251346b66627795b4ae1cbdebcb7c5784 (diff)
downloadwix-a790cb2da9600562e2622eb074274b0d69257484.tar.gz
wix-a790cb2da9600562e2622eb074274b0d69257484.tar.bz2
wix-a790cb2da9600562e2622eb074274b0d69257484.zip
The Great Tuple to Symbol File Rename (tm)
Diffstat (limited to 'src/wixext/Symbols')
-rw-r--r--src/wixext/Symbols/DifxAppSymbolDefinitions.cs39
-rw-r--r--src/wixext/Symbols/MsiDriverPackagesSymbol.cs63
2 files changed, 102 insertions, 0 deletions
diff --git a/src/wixext/Symbols/DifxAppSymbolDefinitions.cs b/src/wixext/Symbols/DifxAppSymbolDefinitions.cs
new file mode 100644
index 00000000..76f4d88f
--- /dev/null
+++ b/src/wixext/Symbols/DifxAppSymbolDefinitions.cs
@@ -0,0 +1,39 @@
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
3namespace WixToolset.DifxApp
4{
5 using System;
6 using WixToolset.Data;
7
8 public enum DifxAppSymbolDefinitionType
9 {
10 MsiDriverPackages,
11 }
12
13 public static partial class DifxAppSymbolDefinitions
14 {
15 public static readonly Version Version = new Version("4.0.0");
16
17 public static IntermediateSymbolDefinition ByName(string name)
18 {
19 if (!Enum.TryParse(name, out DifxAppSymbolDefinitionType type))
20 {
21 return null;
22 }
23
24 return ByType(type);
25 }
26
27 public static IntermediateSymbolDefinition ByType(DifxAppSymbolDefinitionType type)
28 {
29 switch (type)
30 {
31 case DifxAppSymbolDefinitionType.MsiDriverPackages:
32 return DifxAppSymbolDefinitions.MsiDriverPackages;
33
34 default:
35 throw new ArgumentOutOfRangeException(nameof(type));
36 }
37 }
38 }
39}
diff --git a/src/wixext/Symbols/MsiDriverPackagesSymbol.cs b/src/wixext/Symbols/MsiDriverPackagesSymbol.cs
new file mode 100644
index 00000000..2fd91bc8
--- /dev/null
+++ b/src/wixext/Symbols/MsiDriverPackagesSymbol.cs
@@ -0,0 +1,63 @@
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
3namespace WixToolset.DifxApp
4{
5 using WixToolset.Data;
6 using WixToolset.DifxApp.Symbols;
7
8 public static partial class DifxAppSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition MsiDriverPackages = new IntermediateSymbolDefinition(
11 DifxAppSymbolDefinitionType.MsiDriverPackages.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.ComponentRef), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.Flags), IntermediateFieldType.Number),
16 new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.Sequence), IntermediateFieldType.Number),
17 },
18 typeof(MsiDriverPackagesSymbol));
19 }
20}
21
22namespace WixToolset.DifxApp.Symbols
23{
24 using WixToolset.Data;
25
26 public enum MsiDriverPackagesSymbolFields
27 {
28 ComponentRef,
29 Flags,
30 Sequence,
31 }
32
33 public class MsiDriverPackagesSymbol : IntermediateSymbol
34 {
35 public MsiDriverPackagesSymbol() : base(DifxAppSymbolDefinitions.MsiDriverPackages, null, null)
36 {
37 }
38
39 public MsiDriverPackagesSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DifxAppSymbolDefinitions.MsiDriverPackages, sourceLineNumber, id)
40 {
41 }
42
43 public IntermediateField this[MsiDriverPackagesSymbolFields index] => this.Fields[(int)index];
44
45 public string ComponentRef
46 {
47 get => this.Fields[(int)MsiDriverPackagesSymbolFields.ComponentRef].AsString();
48 set => this.Set((int)MsiDriverPackagesSymbolFields.ComponentRef, value);
49 }
50
51 public int Flags
52 {
53 get => this.Fields[(int)MsiDriverPackagesSymbolFields.Flags].AsNumber();
54 set => this.Set((int)MsiDriverPackagesSymbolFields.Flags, value);
55 }
56
57 public int? Sequence
58 {
59 get => this.Fields[(int)MsiDriverPackagesSymbolFields.Sequence].AsNullableNumber();
60 set => this.Set((int)MsiDriverPackagesSymbolFields.Sequence, value);
61 }
62 }
63} \ No newline at end of file