aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Data/Tuples/DialogTuple.cs
blob: b8bb236166bb0a41b5c2858bdb85f88bcbb36848 (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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// 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 Dialog = new IntermediateTupleDefinition(
            TupleDefinitionType.Dialog,
            new[]
            {
                new IntermediateFieldDefinition(nameof(DialogTupleFields.Dialog), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(DialogTupleFields.HCentering), IntermediateFieldType.Number),
                new IntermediateFieldDefinition(nameof(DialogTupleFields.VCentering), IntermediateFieldType.Number),
                new IntermediateFieldDefinition(nameof(DialogTupleFields.Width), IntermediateFieldType.Number),
                new IntermediateFieldDefinition(nameof(DialogTupleFields.Height), IntermediateFieldType.Number),
                new IntermediateFieldDefinition(nameof(DialogTupleFields.Attributes), IntermediateFieldType.Number),
                new IntermediateFieldDefinition(nameof(DialogTupleFields.Title), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(DialogTupleFields.Control_First), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(DialogTupleFields.Control_Default), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(DialogTupleFields.Control_Cancel), IntermediateFieldType.String),
            },
            typeof(DialogTuple));
    }
}

namespace WixToolset.Data.Tuples
{
    public enum DialogTupleFields
    {
        Dialog,
        HCentering,
        VCentering,
        Width,
        Height,
        Attributes,
        Title,
        Control_First,
        Control_Default,
        Control_Cancel,
    }

    public class DialogTuple : IntermediateTuple
    {
        public DialogTuple() : base(TupleDefinitions.Dialog, null, null)
        {
        }

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

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

        public string Dialog
        {
            get => (string)this.Fields[(int)DialogTupleFields.Dialog]?.Value;
            set => this.Set((int)DialogTupleFields.Dialog, value);
        }

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

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

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

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

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

        public string Title
        {
            get => (string)this.Fields[(int)DialogTupleFields.Title]?.Value;
            set => this.Set((int)DialogTupleFields.Title, value);
        }

        public string Control_First
        {
            get => (string)this.Fields[(int)DialogTupleFields.Control_First]?.Value;
            set => this.Set((int)DialogTupleFields.Control_First, value);
        }

        public string Control_Default
        {
            get => (string)this.Fields[(int)DialogTupleFields.Control_Default]?.Value;
            set => this.Set((int)DialogTupleFields.Control_Default, value);
        }

        public string Control_Cancel
        {
            get => (string)this.Fields[(int)DialogTupleFields.Control_Cancel]?.Value;
            set => this.Set((int)DialogTupleFields.Control_Cancel, value);
        }
    }
}