aboutsummaryrefslogtreecommitdiff
path: root/src/wixext/FirewallWindowsInstallerBackendExtension.cs
blob: a1c78f0454eda853b8f2843f3a4ad5440efc57e9 (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
// 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 System.Linq;
    using System.Xml;
    using WixToolset.Data.WindowsInstaller;
    using WixToolset.Extensibility;

    public class FirewallWindowsInstallerBackendExtension : BaseWindowsInstallerBackendExtension
    {
        private static readonly TableDefinition[] Tables = LoadTables();

        protected override TableDefinition[] TableDefinitionsForTuples => Tables;

        private static TableDefinition[] LoadTables()
        {
            using (var resourceStream = typeof(FirewallWindowsInstallerBackendExtension).Assembly.GetManifestResourceStream("WixToolset.Firewall.tables.xml"))
            using (var reader = XmlReader.Create(resourceStream))
            {
                var tables = TableDefinitionCollection.Load(reader);
                return tables.ToArray();
            }
        }
    }
}