summaryrefslogtreecommitdiff
path: root/src/wixext/Symbols/FileSharePermissionsSymbol.cs
blob: 3db92f225b81cf4387e1f821e2723fc3e6887216 (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
// 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.Symbols;

    public static partial class UtilSymbolDefinitions
    {
        public static readonly IntermediateSymbolDefinition FileSharePermissions = new IntermediateSymbolDefinition(
            UtilSymbolDefinitionType.FileSharePermissions.ToString(),
            new[]
            {
                new IntermediateFieldDefinition(nameof(FileSharePermissionsSymbolFields.FileShareRef), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(FileSharePermissionsSymbolFields.UserRef), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(FileSharePermissionsSymbolFields.Permissions), IntermediateFieldType.Number),
            },
            typeof(FileSharePermissionsSymbol));
    }
}

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

    public enum FileSharePermissionsSymbolFields
    {
        FileShareRef,
        UserRef,
        Permissions,
    }

    public class FileSharePermissionsSymbol : IntermediateSymbol
    {
        public FileSharePermissionsSymbol() : base(UtilSymbolDefinitions.FileSharePermissions, null, null)
        {
        }

        public FileSharePermissionsSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilSymbolDefinitions.FileSharePermissions, sourceLineNumber, id)
        {
        }

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

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

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

        public int Permissions
        {
            get => this.Fields[(int)FileSharePermissionsSymbolFields.Permissions].AsNumber();
            set => this.Set((int)FileSharePermissionsSymbolFields.Permissions, value);
        }
    }
}