aboutsummaryrefslogtreecommitdiff
path: root/src/ext/ComPlus/wixext/Symbols/ComPlusPartitionPropertySymbol.cs
blob: e42feae2ea9516321ccdfd6ce8a77d2383f08adf (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.ComPlus
{
    using WixToolset.Data;
    using WixToolset.ComPlus.Symbols;

    public static partial class ComPlusSymbolDefinitions
    {
        public static readonly IntermediateSymbolDefinition ComPlusPartitionProperty = new IntermediateSymbolDefinition(
            ComPlusSymbolDefinitionType.ComPlusPartitionProperty.ToString(),
            new[]
            {
                new IntermediateFieldDefinition(nameof(ComPlusPartitionPropertySymbolFields.PartitionRef), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(ComPlusPartitionPropertySymbolFields.Name), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(ComPlusPartitionPropertySymbolFields.Value), IntermediateFieldType.String),
            },
            typeof(ComPlusPartitionPropertySymbol));
    }
}

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

    public enum ComPlusPartitionPropertySymbolFields
    {
        PartitionRef,
        Name,
        Value,
    }

    public class ComPlusPartitionPropertySymbol : IntermediateSymbol
    {
        public ComPlusPartitionPropertySymbol() : base(ComPlusSymbolDefinitions.ComPlusPartitionProperty, null, null)
        {
        }

        public ComPlusPartitionPropertySymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(ComPlusSymbolDefinitions.ComPlusPartitionProperty, sourceLineNumber, id)
        {
        }

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

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

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

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