main
cs 84 lines 3.21 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 Directory = new IntermediateSymbolDefinition(
10 SymbolDefinitionType.Directory,
11 new[]
12 {
13 new IntermediateFieldDefinition(nameof(DirectorySymbolFields.ParentDirectoryRef), IntermediateFieldType.String),
14 new IntermediateFieldDefinition(nameof(DirectorySymbolFields.Name), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(DirectorySymbolFields.ShortName), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(DirectorySymbolFields.SourceName), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(DirectorySymbolFields.SourceShortName), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(DirectorySymbolFields.ComponentGuidGenerationSeed), IntermediateFieldType.String),
19 },
20 typeof(DirectorySymbol));
21 }
22 }
23
24 namespace WixToolset.Data.Symbols
25 {
26 public enum DirectorySymbolFields
27 {
28 ParentDirectoryRef,
29 Name,
30 ShortName,
31 SourceName,
32 SourceShortName,
33 ComponentGuidGenerationSeed,
34 }
35
36 public class DirectorySymbol : IntermediateSymbol
37 {
38 public DirectorySymbol() : base(SymbolDefinitions.Directory, null, null)
39 {
40 }
41
42 public DirectorySymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.Directory, sourceLineNumber, id)
43 {
44 }
45
46 public IntermediateField this[DirectorySymbolFields index] => this.Fields[(int)index];
47
48 public string ParentDirectoryRef
49 {
50 get => (string)this.Fields[(int)DirectorySymbolFields.ParentDirectoryRef];
51 set => this.Set((int)DirectorySymbolFields.ParentDirectoryRef, value);
52 }
53
54 public string Name
55 {
56 get => (string)this.Fields[(int)DirectorySymbolFields.Name];
57 set => this.Set((int)DirectorySymbolFields.Name, value);
58 }
59
60 public string ShortName
61 {
62 get => (string)this.Fields[(int)DirectorySymbolFields.ShortName];
63 set => this.Set((int)DirectorySymbolFields.ShortName, value);
64 }
65
66 public string SourceName
67 {
68 get => (string)this.Fields[(int)DirectorySymbolFields.SourceName];
69 set => this.Set((int)DirectorySymbolFields.SourceName, value);
70 }
71
72 public string SourceShortName
73 {
74 get => (string)this.Fields[(int)DirectorySymbolFields.SourceShortName];
75 set => this.Set((int)DirectorySymbolFields.SourceShortName, value);
76 }
77
78 public string ComponentGuidGenerationSeed
79 {
80 get => (string)this.Fields[(int)DirectorySymbolFields.ComponentGuidGenerationSeed];
81 set => this.Set((int)DirectorySymbolFields.ComponentGuidGenerationSeed, value);
82 }
83 }
84 }