diff options
author | Rob Mensching <rob@firegiant.com> | 2021-05-03 09:55:22 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2021-05-03 09:55:22 -0700 |
commit | ff659159e041bf6c083e6b7fcb9b726065a9dd73 (patch) | |
tree | ea95bf3d3e031edcee65de33b9e6954178be669c /src/ext/Util/wixext/Symbols/UserSymbol.cs | |
parent | 8a8a25695351ee542f08886a9d0957c78c6af366 (diff) | |
download | wix-ff659159e041bf6c083e6b7fcb9b726065a9dd73.tar.gz wix-ff659159e041bf6c083e6b7fcb9b726065a9dd73.tar.bz2 wix-ff659159e041bf6c083e6b7fcb9b726065a9dd73.zip |
Move Util.wixext into ext
Diffstat (limited to 'src/ext/Util/wixext/Symbols/UserSymbol.cs')
-rw-r--r-- | src/ext/Util/wixext/Symbols/UserSymbol.cs | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/src/ext/Util/wixext/Symbols/UserSymbol.cs b/src/ext/Util/wixext/Symbols/UserSymbol.cs new file mode 100644 index 00000000..5f00064b --- /dev/null +++ b/src/ext/Util/wixext/Symbols/UserSymbol.cs | |||
@@ -0,0 +1,79 @@ | |||
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.Util | ||
4 | { | ||
5 | using WixToolset.Data; | ||
6 | using WixToolset.Util.Symbols; | ||
7 | |||
8 | public static partial class UtilSymbolDefinitions | ||
9 | { | ||
10 | public static readonly IntermediateSymbolDefinition User = new IntermediateSymbolDefinition( | ||
11 | UtilSymbolDefinitionType.User.ToString(), | ||
12 | new[] | ||
13 | { | ||
14 | new IntermediateFieldDefinition(nameof(UserSymbolFields.ComponentRef), IntermediateFieldType.String), | ||
15 | new IntermediateFieldDefinition(nameof(UserSymbolFields.Name), IntermediateFieldType.String), | ||
16 | new IntermediateFieldDefinition(nameof(UserSymbolFields.Domain), IntermediateFieldType.String), | ||
17 | new IntermediateFieldDefinition(nameof(UserSymbolFields.Password), IntermediateFieldType.String), | ||
18 | new IntermediateFieldDefinition(nameof(UserSymbolFields.Attributes), IntermediateFieldType.Number), | ||
19 | }, | ||
20 | typeof(UserSymbol)); | ||
21 | } | ||
22 | } | ||
23 | |||
24 | namespace WixToolset.Util.Symbols | ||
25 | { | ||
26 | using WixToolset.Data; | ||
27 | |||
28 | public enum UserSymbolFields | ||
29 | { | ||
30 | ComponentRef, | ||
31 | Name, | ||
32 | Domain, | ||
33 | Password, | ||
34 | Attributes, | ||
35 | } | ||
36 | |||
37 | public class UserSymbol : IntermediateSymbol | ||
38 | { | ||
39 | public UserSymbol() : base(UtilSymbolDefinitions.User, null, null) | ||
40 | { | ||
41 | } | ||
42 | |||
43 | public UserSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilSymbolDefinitions.User, sourceLineNumber, id) | ||
44 | { | ||
45 | } | ||
46 | |||
47 | public IntermediateField this[UserSymbolFields index] => this.Fields[(int)index]; | ||
48 | |||
49 | public string ComponentRef | ||
50 | { | ||
51 | get => this.Fields[(int)UserSymbolFields.ComponentRef].AsString(); | ||
52 | set => this.Set((int)UserSymbolFields.ComponentRef, value); | ||
53 | } | ||
54 | |||
55 | public string Name | ||
56 | { | ||
57 | get => this.Fields[(int)UserSymbolFields.Name].AsString(); | ||
58 | set => this.Set((int)UserSymbolFields.Name, value); | ||
59 | } | ||
60 | |||
61 | public string Domain | ||
62 | { | ||
63 | get => this.Fields[(int)UserSymbolFields.Domain].AsString(); | ||
64 | set => this.Set((int)UserSymbolFields.Domain, value); | ||
65 | } | ||
66 | |||
67 | public string Password | ||
68 | { | ||
69 | get => this.Fields[(int)UserSymbolFields.Password].AsString(); | ||
70 | set => this.Set((int)UserSymbolFields.Password, value); | ||
71 | } | ||
72 | |||
73 | public int Attributes | ||
74 | { | ||
75 | get => this.Fields[(int)UserSymbolFields.Attributes].AsNumber(); | ||
76 | set => this.Set((int)UserSymbolFields.Attributes, value); | ||
77 | } | ||
78 | } | ||
79 | } \ No newline at end of file | ||