aboutsummaryrefslogtreecommitdiff
path: root/src/wixext/Tuples/WixFirewallExceptionTuple.cs
blob: d08b9e45e6678f3af071d9f8dc64f7826c041fa2 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
// 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.Firewall
{
    using WixToolset.Data;
    using WixToolset.Firewall.Tuples;

    public static partial class FirewallTupleDefinitions
    {
        public static readonly IntermediateTupleDefinition WixFirewallException = new IntermediateTupleDefinition(
            FirewallTupleDefinitionType.WixFirewallException.ToString(),
            new[]
            {
                new IntermediateFieldDefinition(nameof(WixFirewallExceptionTupleFields.Name), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(WixFirewallExceptionTupleFields.RemoteAddresses), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(WixFirewallExceptionTupleFields.Port), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(WixFirewallExceptionTupleFields.Protocol), IntermediateFieldType.Number),
                new IntermediateFieldDefinition(nameof(WixFirewallExceptionTupleFields.Program), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(WixFirewallExceptionTupleFields.Attributes), IntermediateFieldType.Number),
                new IntermediateFieldDefinition(nameof(WixFirewallExceptionTupleFields.Profile), IntermediateFieldType.Number),
                new IntermediateFieldDefinition(nameof(WixFirewallExceptionTupleFields.ComponentRef), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(WixFirewallExceptionTupleFields.Description), IntermediateFieldType.String),
            },
            typeof(WixFirewallExceptionTuple));
    }
}

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

    public enum WixFirewallExceptionTupleFields
    {
        Name,
        RemoteAddresses,
        Port,
        Protocol,
        Program,
        Attributes,
        Profile,
        ComponentRef,
        Description,
    }

    public class WixFirewallExceptionTuple : IntermediateTuple
    {
        public WixFirewallExceptionTuple() : base(FirewallTupleDefinitions.WixFirewallException, null, null)
        {
        }

        public WixFirewallExceptionTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(FirewallTupleDefinitions.WixFirewallException, sourceLineNumber, id)
        {
        }

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

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

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

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

        public int? Protocol
        {
            get => this.Fields[(int)WixFirewallExceptionTupleFields.Protocol].AsNullableNumber();
            set => this.Set((int)WixFirewallExceptionTupleFields.Protocol, value);
        }

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

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

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

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

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