diff options
| author | Rob Mensching <rob@firegiant.com> | 2017-11-11 01:45:59 -0800 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2017-11-11 01:45:59 -0800 |
| commit | 9f8cb5374481b6c8a06eb2739858332350f72666 (patch) | |
| tree | 4b09b90d8a516cb5e7d8203759bd2489b6a5d20c /src/WixToolset.Data.WindowsInstaller/WindowsInstallerStandardInternal.cs | |
| parent | 2bb37beda887d120a0ddabf874ad25357101faa1 (diff) | |
| download | wix-9f8cb5374481b6c8a06eb2739858332350f72666.tar.gz wix-9f8cb5374481b6c8a06eb2739858332350f72666.tar.bz2 wix-9f8cb5374481b6c8a06eb2739858332350f72666.zip | |
Additional IR updates
Diffstat (limited to 'src/WixToolset.Data.WindowsInstaller/WindowsInstallerStandardInternal.cs')
| -rw-r--r-- | src/WixToolset.Data.WindowsInstaller/WindowsInstallerStandardInternal.cs | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/WixToolset.Data.WindowsInstaller/WindowsInstallerStandardInternal.cs b/src/WixToolset.Data.WindowsInstaller/WindowsInstallerStandardInternal.cs new file mode 100644 index 00000000..cc6754c3 --- /dev/null +++ b/src/WixToolset.Data.WindowsInstaller/WindowsInstallerStandardInternal.cs | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | // 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. | ||
| 2 | |||
| 3 | namespace WixToolset.Data | ||
| 4 | { | ||
| 5 | using System.Reflection; | ||
| 6 | using System.Xml; | ||
| 7 | using WixToolset.Data.Rows; | ||
| 8 | |||
| 9 | /// <summary> | ||
| 10 | /// Represents the Windows Installer standard objects. | ||
| 11 | /// </summary> | ||
| 12 | public static class WindowsInstallerStandardInternal | ||
| 13 | { | ||
| 14 | private static readonly object lockObject = new object(); | ||
| 15 | |||
| 16 | private static TableDefinitionCollection tableDefinitions; | ||
| 17 | private static WixActionRowCollection standardActions; | ||
| 18 | |||
| 19 | /// <summary> | ||
| 20 | /// Gets the table definitions stored in this assembly. | ||
| 21 | /// </summary> | ||
| 22 | /// <returns>Table definition collection for tables stored in this assembly.</returns> | ||
| 23 | public static TableDefinitionCollection GetTableDefinitions() | ||
| 24 | { | ||
| 25 | lock (lockObject) | ||
| 26 | { | ||
| 27 | if (null == WindowsInstallerStandardInternal.tableDefinitions) | ||
| 28 | { | ||
| 29 | using (XmlReader reader = XmlReader.Create(Assembly.GetExecutingAssembly().GetManifestResourceStream("WixToolset.Data.WindowsInstaller.Data.tables.xml"))) | ||
| 30 | { | ||
| 31 | WindowsInstallerStandardInternal.tableDefinitions = TableDefinitionCollection.Load(reader); | ||
| 32 | } | ||
| 33 | } | ||
| 34 | } | ||
| 35 | |||
| 36 | return WindowsInstallerStandardInternal.tableDefinitions; | ||
| 37 | } | ||
| 38 | |||
| 39 | /// <summary> | ||
| 40 | /// Gets the standard actions stored in this assembly. | ||
| 41 | /// </summary> | ||
| 42 | /// <returns>Collection of standard actions in this assembly.</returns> | ||
| 43 | public static WixActionRowCollection GetStandardActionRows() | ||
| 44 | { | ||
| 45 | lock (lockObject) | ||
| 46 | { | ||
| 47 | if (null == WindowsInstallerStandardInternal.standardActions) | ||
| 48 | { | ||
| 49 | using (XmlReader reader = XmlReader.Create(Assembly.GetExecutingAssembly().GetManifestResourceStream("WixToolset.Data.WindowsInstaller.Data.actions.xml"))) | ||
| 50 | { | ||
| 51 | WindowsInstallerStandardInternal.standardActions = WixActionRowCollection.Load(reader); | ||
| 52 | } | ||
| 53 | } | ||
| 54 | } | ||
| 55 | |||
| 56 | return WindowsInstallerStandardInternal.standardActions; | ||
| 57 | } | ||
| 58 | } | ||
| 59 | } | ||
