aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Data/Tuples/RegLocatorTuple.cs
blob: b098e687aaa008e53169f8ab2a2263f0842d0519 (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
// 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 RegLocator = new IntermediateTupleDefinition(
            TupleDefinitionType.RegLocator,
            new[]
            {
                new IntermediateFieldDefinition(nameof(RegLocatorTupleFields.Signature_), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(RegLocatorTupleFields.Root), IntermediateFieldType.Number),
                new IntermediateFieldDefinition(nameof(RegLocatorTupleFields.Key), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(RegLocatorTupleFields.Name), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(RegLocatorTupleFields.Type), IntermediateFieldType.Number),
            },
            typeof(RegLocatorTuple));
    }
}

namespace WixToolset.Data.Tuples
{
    public enum RegLocatorTupleFields
    {
        Signature_,
        Root,
        Key,
        Name,
        Type,
    }

    public class RegLocatorTuple : IntermediateTuple
    {
        public RegLocatorTuple() : base(TupleDefinitions.RegLocator, null, null)
        {
        }

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

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

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

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

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

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

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