aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Data/Tuples/_StreamsTuple.cs
blob: 1f9d75e865e44bc5fbf01f981dc44db91ded88b1 (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
// 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.Data
{
    using WixToolset.Data.Tuples;

    public static partial class TupleDefinitions
    {
        public static readonly IntermediateTupleDefinition _Streams = new IntermediateTupleDefinition(
            TupleDefinitionType._Streams,
            new[]
            {
                new IntermediateFieldDefinition(nameof(_StreamsTupleFields.Name), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(_StreamsTupleFields.Data), IntermediateFieldType.Path),
            },
            typeof(_StreamsTuple));
    }
}

namespace WixToolset.Data.Tuples
{
    public enum _StreamsTupleFields
    {
        Name,
        Data,
    }

    public class _StreamsTuple : IntermediateTuple
    {
        public _StreamsTuple() : base(TupleDefinitions._Streams, null, null)
        {
        }

        public _StreamsTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions._Streams, sourceLineNumber, id)
        {
        }

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

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

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