aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Data/Symbols/ShortcutSymbol.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Data/Symbols/ShortcutSymbol.cs')
-rw-r--r--src/WixToolset.Data/Symbols/ShortcutSymbol.cs171
1 files changed, 171 insertions, 0 deletions
diff --git a/src/WixToolset.Data/Symbols/ShortcutSymbol.cs b/src/WixToolset.Data/Symbols/ShortcutSymbol.cs
new file mode 100644
index 00000000..f32fe4af
--- /dev/null
+++ b/src/WixToolset.Data/Symbols/ShortcutSymbol.cs
@@ -0,0 +1,171 @@
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.Data
4{
5 using WixToolset.Data.Symbols;
6
7 public static partial class SymbolDefinitions
8 {
9 public static readonly IntermediateSymbolDefinition Shortcut = new IntermediateSymbolDefinition(
10 SymbolDefinitionType.Shortcut,
11 new[]
12 {
13 new IntermediateFieldDefinition(nameof(ShortcutSymbolFields.DirectoryRef), IntermediateFieldType.String),
14 new IntermediateFieldDefinition(nameof(ShortcutSymbolFields.Name), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(ShortcutSymbolFields.ShortName), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(ShortcutSymbolFields.ComponentRef), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(ShortcutSymbolFields.Target), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(ShortcutSymbolFields.Arguments), IntermediateFieldType.String),
19 new IntermediateFieldDefinition(nameof(ShortcutSymbolFields.Description), IntermediateFieldType.String),
20 new IntermediateFieldDefinition(nameof(ShortcutSymbolFields.Hotkey), IntermediateFieldType.Number),
21 new IntermediateFieldDefinition(nameof(ShortcutSymbolFields.IconRef), IntermediateFieldType.String),
22 new IntermediateFieldDefinition(nameof(ShortcutSymbolFields.IconIndex), IntermediateFieldType.Number),
23 new IntermediateFieldDefinition(nameof(ShortcutSymbolFields.Show), IntermediateFieldType.Number),
24 new IntermediateFieldDefinition(nameof(ShortcutSymbolFields.WkDir), IntermediateFieldType.String),
25 new IntermediateFieldDefinition(nameof(ShortcutSymbolFields.DisplayResourceDLL), IntermediateFieldType.String),
26 new IntermediateFieldDefinition(nameof(ShortcutSymbolFields.DisplayResourceId), IntermediateFieldType.Number),
27 new IntermediateFieldDefinition(nameof(ShortcutSymbolFields.DescriptionResourceDLL), IntermediateFieldType.String),
28 new IntermediateFieldDefinition(nameof(ShortcutSymbolFields.DescriptionResourceId), IntermediateFieldType.Number),
29 },
30 typeof(ShortcutSymbol));
31 }
32}
33
34namespace WixToolset.Data.Symbols
35{
36 public enum ShortcutSymbolFields
37 {
38 DirectoryRef,
39 Name,
40 ShortName,
41 ComponentRef,
42 Target,
43 Arguments,
44 Description,
45 Hotkey,
46 IconRef,
47 IconIndex,
48 Show,
49 WkDir,
50 DisplayResourceDLL,
51 DisplayResourceId,
52 DescriptionResourceDLL,
53 DescriptionResourceId,
54 }
55
56 public enum ShortcutShowType
57 {
58 Normal = 1,
59 Maximized = 3,
60 Minimized = 7
61 }
62
63 public class ShortcutSymbol : IntermediateSymbol
64 {
65 public ShortcutSymbol() : base(SymbolDefinitions.Shortcut, null, null)
66 {
67 }
68
69 public ShortcutSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.Shortcut, sourceLineNumber, id)
70 {
71 }
72
73 public IntermediateField this[ShortcutSymbolFields index] => this.Fields[(int)index];
74
75 public string DirectoryRef
76 {
77 get => (string)this.Fields[(int)ShortcutSymbolFields.DirectoryRef];
78 set => this.Set((int)ShortcutSymbolFields.DirectoryRef, value);
79 }
80
81 public string Name
82 {
83 get => (string)this.Fields[(int)ShortcutSymbolFields.Name];
84 set => this.Set((int)ShortcutSymbolFields.Name, value);
85 }
86
87 public string ShortName
88 {
89 get => (string)this.Fields[(int)ShortcutSymbolFields.ShortName];
90 set => this.Set((int)ShortcutSymbolFields.ShortName, value);
91 }
92
93 public string ComponentRef
94 {
95 get => (string)this.Fields[(int)ShortcutSymbolFields.ComponentRef];
96 set => this.Set((int)ShortcutSymbolFields.ComponentRef, value);
97 }
98
99 public string Target
100 {
101 get => (string)this.Fields[(int)ShortcutSymbolFields.Target];
102 set => this.Set((int)ShortcutSymbolFields.Target, value);
103 }
104
105 public string Arguments
106 {
107 get => (string)this.Fields[(int)ShortcutSymbolFields.Arguments];
108 set => this.Set((int)ShortcutSymbolFields.Arguments, value);
109 }
110
111 public string Description
112 {
113 get => (string)this.Fields[(int)ShortcutSymbolFields.Description];
114 set => this.Set((int)ShortcutSymbolFields.Description, value);
115 }
116
117 public int? Hotkey
118 {
119 get => this.Fields[(int)ShortcutSymbolFields.Hotkey].AsNullableNumber();
120 set => this.Set((int)ShortcutSymbolFields.Hotkey, value);
121 }
122
123 public string IconRef
124 {
125 get => (string)this.Fields[(int)ShortcutSymbolFields.IconRef];
126 set => this.Set((int)ShortcutSymbolFields.IconRef, value);
127 }
128
129 public int? IconIndex
130 {
131 get => this.Fields[(int)ShortcutSymbolFields.IconIndex].AsNullableNumber();
132 set => this.Set((int)ShortcutSymbolFields.IconIndex, value);
133 }
134
135 public ShortcutShowType? Show
136 {
137 get => (ShortcutShowType?)this.Fields[(int)ShortcutSymbolFields.Show].AsNullableNumber();
138 set => this.Set((int)ShortcutSymbolFields.Show, (int?)value);
139 }
140
141 public string WorkingDirectory
142 {
143 get => (string)this.Fields[(int)ShortcutSymbolFields.WkDir];
144 set => this.Set((int)ShortcutSymbolFields.WkDir, value);
145 }
146
147 public string DisplayResourceDll
148 {
149 get => (string)this.Fields[(int)ShortcutSymbolFields.DisplayResourceDLL];
150 set => this.Set((int)ShortcutSymbolFields.DisplayResourceDLL, value);
151 }
152
153 public int? DisplayResourceId
154 {
155 get => this.Fields[(int)ShortcutSymbolFields.DisplayResourceId].AsNullableNumber();
156 set => this.Set((int)ShortcutSymbolFields.DisplayResourceId, value);
157 }
158
159 public string DescriptionResourceDll
160 {
161 get => (string)this.Fields[(int)ShortcutSymbolFields.DescriptionResourceDLL];
162 set => this.Set((int)ShortcutSymbolFields.DescriptionResourceDLL, value);
163 }
164
165 public int? DescriptionResourceId
166 {
167 get => this.Fields[(int)ShortcutSymbolFields.DescriptionResourceId].AsNullableNumber();
168 set => this.Set((int)ShortcutSymbolFields.DescriptionResourceId, value);
169 }
170 }
171}