diff options
Diffstat (limited to 'src/api/wix/WixToolset.Data/Symbols/WixBundlePackageExitCodeSymbol.cs')
-rw-r--r-- | src/api/wix/WixToolset.Data/Symbols/WixBundlePackageExitCodeSymbol.cs | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/src/api/wix/WixToolset.Data/Symbols/WixBundlePackageExitCodeSymbol.cs b/src/api/wix/WixToolset.Data/Symbols/WixBundlePackageExitCodeSymbol.cs new file mode 100644 index 00000000..d77d9d58 --- /dev/null +++ b/src/api/wix/WixToolset.Data/Symbols/WixBundlePackageExitCodeSymbol.cs | |||
@@ -0,0 +1,71 @@ | |||
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 WixBundlePackageExitCode = new IntermediateSymbolDefinition( | ||
10 | SymbolDefinitionType.WixBundlePackageExitCode, | ||
11 | new[] | ||
12 | { | ||
13 | new IntermediateFieldDefinition(nameof(WixBundlePackageExitCodeSymbolFields.ChainPackageId), IntermediateFieldType.String), | ||
14 | new IntermediateFieldDefinition(nameof(WixBundlePackageExitCodeSymbolFields.Code), IntermediateFieldType.Number), | ||
15 | new IntermediateFieldDefinition(nameof(WixBundlePackageExitCodeSymbolFields.Behavior), IntermediateFieldType.String), | ||
16 | }, | ||
17 | typeof(WixBundlePackageExitCodeSymbol)); | ||
18 | } | ||
19 | } | ||
20 | |||
21 | namespace WixToolset.Data.Symbols | ||
22 | { | ||
23 | using System; | ||
24 | |||
25 | public enum WixBundlePackageExitCodeSymbolFields | ||
26 | { | ||
27 | ChainPackageId, | ||
28 | Code, | ||
29 | Behavior, | ||
30 | } | ||
31 | |||
32 | public enum ExitCodeBehaviorType | ||
33 | { | ||
34 | NotSet = -1, | ||
35 | Success, | ||
36 | Error, | ||
37 | ScheduleReboot, | ||
38 | ForceReboot, | ||
39 | } | ||
40 | |||
41 | public class WixBundlePackageExitCodeSymbol : IntermediateSymbol | ||
42 | { | ||
43 | public WixBundlePackageExitCodeSymbol() : base(SymbolDefinitions.WixBundlePackageExitCode, null, null) | ||
44 | { | ||
45 | } | ||
46 | |||
47 | public WixBundlePackageExitCodeSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixBundlePackageExitCode, sourceLineNumber, id) | ||
48 | { | ||
49 | } | ||
50 | |||
51 | public IntermediateField this[WixBundlePackageExitCodeSymbolFields index] => this.Fields[(int)index]; | ||
52 | |||
53 | public string ChainPackageId | ||
54 | { | ||
55 | get => (string)this.Fields[(int)WixBundlePackageExitCodeSymbolFields.ChainPackageId]; | ||
56 | set => this.Set((int)WixBundlePackageExitCodeSymbolFields.ChainPackageId, value); | ||
57 | } | ||
58 | |||
59 | public int? Code | ||
60 | { | ||
61 | get => (int?)this.Fields[(int)WixBundlePackageExitCodeSymbolFields.Code]; | ||
62 | set => this.Set((int)WixBundlePackageExitCodeSymbolFields.Code, value); | ||
63 | } | ||
64 | |||
65 | public ExitCodeBehaviorType Behavior | ||
66 | { | ||
67 | get => Enum.TryParse((string)this.Fields[(int)WixBundlePackageExitCodeSymbolFields.Behavior], true, out ExitCodeBehaviorType value) ? value : ExitCodeBehaviorType.NotSet; | ||
68 | set => this.Set((int)WixBundlePackageExitCodeSymbolFields.Behavior, value.ToString()); | ||
69 | } | ||
70 | } | ||
71 | } | ||