main
cs 68 lines 2.44 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 EventMapping = new IntermediateSymbolDefinition(
10 SymbolDefinitionType.EventMapping,
11 new[]
12 {
13 new IntermediateFieldDefinition(nameof(EventMappingSymbolFields.DialogRef), IntermediateFieldType.String),
14 new IntermediateFieldDefinition(nameof(EventMappingSymbolFields.ControlRef), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(EventMappingSymbolFields.Event), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(EventMappingSymbolFields.Attribute), IntermediateFieldType.String),
17 },
18 typeof(EventMappingSymbol));
19 }
20 }
21
22 namespace WixToolset.Data.Symbols
23 {
24 public enum EventMappingSymbolFields
25 {
26 DialogRef,
27 ControlRef,
28 Event,
29 Attribute,
30 }
31
32 public class EventMappingSymbol : IntermediateSymbol
33 {
34 public EventMappingSymbol() : base(SymbolDefinitions.EventMapping, null, null)
35 {
36 }
37
38 public EventMappingSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.EventMapping, sourceLineNumber, id)
39 {
40 }
41
42 public IntermediateField this[EventMappingSymbolFields index] => this.Fields[(int)index];
43
44 public string DialogRef
45 {
46 get => (string)this.Fields[(int)EventMappingSymbolFields.DialogRef];
47 set => this.Set((int)EventMappingSymbolFields.DialogRef, value);
48 }
49
50 public string ControlRef
51 {
52 get => (string)this.Fields[(int)EventMappingSymbolFields.ControlRef];
53 set => this.Set((int)EventMappingSymbolFields.ControlRef, value);
54 }
55
56 public string Event
57 {
58 get => (string)this.Fields[(int)EventMappingSymbolFields.Event];
59 set => this.Set((int)EventMappingSymbolFields.Event, value);
60 }
61
62 public string Attribute
63 {
64 get => (string)this.Fields[(int)EventMappingSymbolFields.Attribute];
65 set => this.Set((int)EventMappingSymbolFields.Attribute, value);
66 }
67 }
68 }