aboutsummaryrefslogtreecommitdiff
path: root/src/ext/Iis/wixext/Symbols/IIsPropertySymbol.cs
blob: 9cf670148d60263550c7680e9014da45f9d4d212 (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.Iis
{
    using WixToolset.Data;
    using WixToolset.Iis.Symbols;

    public static partial class IisSymbolDefinitions
    {
        public static readonly IntermediateSymbolDefinition IIsProperty = new IntermediateSymbolDefinition(
            IisSymbolDefinitionType.IIsProperty.ToString(),
            new[]
            {
                new IntermediateFieldDefinition(nameof(IIsPropertySymbolFields.ComponentRef), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(IIsPropertySymbolFields.Attributes), IntermediateFieldType.Number),
                new IntermediateFieldDefinition(nameof(IIsPropertySymbolFields.Value), IntermediateFieldType.String),
            },
            typeof(IIsPropertySymbol));
    }
}

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

    public enum IIsPropertySymbolFields
    {
        ComponentRef,
        Attributes,
        Value,
    }

    public class IIsPropertySymbol : IntermediateSymbol
    {
        public IIsPropertySymbol() : base(IisSymbolDefinitions.IIsProperty, null, null)
        {
        }

        public IIsPropertySymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisSymbolDefinitions.IIsProperty, sourceLineNumber, id)
        {
        }

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

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

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

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