aboutsummaryrefslogtreecommitdiff
path: root/src/wixext/Tuples/UserGroupTuple.cs
blob: 0386a26ee4e94a773bce5bc4533794b0ae2aca9f (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.User_), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(UserGroupTupleFields.Group_), IntermediateFieldType.String),
            },
            typeof(UserGroupTuple));
    }
}

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

    public enum UserGroupTupleFields
    {
        User_,
        Group_,
    }

    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 User_
        {
            get => this.Fields[(int)UserGroupTupleFields.User_].AsString();
            set => this.Set((int)UserGroupTupleFields.User_, value);
        }

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