aboutsummaryrefslogtreecommitdiff
path: root/src/wixext/Tuples/UserGroupTuple.cs
blob: 30c5e9ff49fdf9f04343be5c9b9845410ebc2e48 (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
// 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.Util
{
    using WixToolset.Data;
    using WixToolset.Util.Tuples;

    public static partial class UtilTupleDefinitions
    {
        public static readonly IntermediateTupleDefinition UserGroup = new IntermediateTupleDefinition(
            UtilTupleDefinitionType.UserGroup.ToString(),
            new[]
            {
                new IntermediateFieldDefinition(nameof(UserGroupTupleFields.UserRef), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(UserGroupTupleFields.GroupRef), IntermediateFieldType.String),
            },
            typeof(UserGroupTuple));
    }
}

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

    public enum UserGroupTupleFields
    {
        UserRef,
        GroupRef,
    }

    public class UserGroupTuple : IntermediateTuple
    {
        public UserGroupTuple() : base(UtilTupleDefinitions.UserGroup, null, null)
        {
        }

        public UserGroupTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.UserGroup, sourceLineNumber, id)
        {
        }

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

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

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