aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Data/Tuples/ControlEventTuple.cs
blob: 9c4603539d6075baf07064793c0f9893b289ce0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// 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.

namespace WixToolset.Data
{
    using WixToolset.Data.Tuples;

    public static partial class TupleDefinitions
    {
        public static readonly IntermediateTupleDefinition ControlEvent = new IntermediateTupleDefinition(
            TupleDefinitionType.ControlEvent,
            new[]
            {
                new IntermediateFieldDefinition(nameof(ControlEventTupleFields.DialogRef), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(ControlEventTupleFields.ControlRef), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(ControlEventTupleFields.Event), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(ControlEventTupleFields.Argument), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(ControlEventTupleFields.Condition), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(ControlEventTupleFields.Ordering), IntermediateFieldType.Number),
            },
            typeof(ControlEventTuple));
    }
}

namespace WixToolset.Data.Tuples
{
    public enum ControlEventTupleFields
    {
        DialogRef,
        ControlRef,
        Event,
        Argument,
        Condition,
        Ordering,
    }

    public class ControlEventTuple : IntermediateTuple
    {
        public ControlEventTuple() : base(TupleDefinitions.ControlEvent, null, null)
        {
        }

        public ControlEventTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.ControlEvent, sourceLineNumber, id)
        {
        }

        public IntermediateField this[ControlEventTupleFields index] => this.Fields[(int)index];

        public string DialogRef
        {
            get => (string)this.Fields[(int)ControlEventTupleFields.DialogRef];
            set => this.Set((int)ControlEventTupleFields.DialogRef, value);
        }

        public string ControlRef
        {
            get => (string)this.Fields[(int)ControlEventTupleFields.ControlRef];
            set => this.Set((int)ControlEventTupleFields.ControlRef, value);
        }

        public string Event
        {
            get => (string)this.Fields[(int)ControlEventTupleFields.Event];
            set => this.Set((int)ControlEventTupleFields.Event, value);
        }

        public string Argument
        {
            get => (string)this.Fields[(int)ControlEventTupleFields.Argument];
            set => this.Set((int)ControlEventTupleFields.Argument, value);
        }

        public string Condition
        {
            get => (string)this.Fields[(int)ControlEventTupleFields.Condition];
            set => this.Set((int)ControlEventTupleFields.Condition, value);
        }

        public int? Ordering
        {
            get => (int?)this.Fields[(int)ControlEventTupleFields.Ordering];
            set => this.Set((int)ControlEventTupleFields.Ordering, value);
        }
    }
}