diff options
| author | Rob Mensching <rob@firegiant.com> | 2021-05-03 17:00:34 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2021-05-03 17:00:34 -0700 |
| commit | 592c6e2f7407c291a7bf9ef4c8ce50da9798cc68 (patch) | |
| tree | af42d0518b91cdc31590884006a2624bf7cdf4ed /src/ext/UI/wixext/UIDecompiler.cs | |
| parent | 0e7fa93306858a9adde5b64ede920492632ba9e6 (diff) | |
| download | wix-592c6e2f7407c291a7bf9ef4c8ce50da9798cc68.tar.gz wix-592c6e2f7407c291a7bf9ef4c8ce50da9798cc68.tar.bz2 wix-592c6e2f7407c291a7bf9ef4c8ce50da9798cc68.zip | |
Move UI.wixext into ext
Diffstat (limited to 'src/ext/UI/wixext/UIDecompiler.cs')
| -rw-r--r-- | src/ext/UI/wixext/UIDecompiler.cs | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/ext/UI/wixext/UIDecompiler.cs b/src/ext/UI/wixext/UIDecompiler.cs new file mode 100644 index 00000000..2493e7c7 --- /dev/null +++ b/src/ext/UI/wixext/UIDecompiler.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.Extensions | ||
| 4 | { | ||
| 5 | #if TODO_CONSIDER_DECOMPILER | ||
| 6 | using System; | ||
| 7 | using System.Collections; | ||
| 8 | using System.Diagnostics; | ||
| 9 | using System.Globalization; | ||
| 10 | using WixToolset.Data; | ||
| 11 | using WixToolset.Extensibility; | ||
| 12 | using Wix = WixToolset.Data.Serialize; | ||
| 13 | |||
| 14 | /// <summary> | ||
| 15 | /// The decompiler for the WiX Toolset UI Extension. | ||
| 16 | /// </summary> | ||
| 17 | public sealed class UIDecompiler : DecompilerExtension | ||
| 18 | { | ||
| 19 | private bool removeLibraryRows; | ||
| 20 | |||
| 21 | /// <summary> | ||
| 22 | /// Get the extensions library to be removed. | ||
| 23 | /// </summary> | ||
| 24 | /// <param name="tableDefinitions">Table definitions for library.</param> | ||
| 25 | /// <returns>Library to remove from decompiled output.</returns> | ||
| 26 | public override Library GetLibraryToRemove(TableDefinitionCollection tableDefinitions) | ||
| 27 | { | ||
| 28 | return removeLibraryRows ? UIExtensionData.GetExtensionLibrary(tableDefinitions) : null; | ||
| 29 | } | ||
| 30 | |||
| 31 | /// <summary> | ||
| 32 | /// Called at the beginning of the decompilation of a database. | ||
| 33 | /// </summary> | ||
| 34 | /// <param name="tables">The collection of all tables.</param> | ||
| 35 | public override void Initialize(TableIndexedCollection tables) | ||
| 36 | { | ||
| 37 | Table propertyTable = tables["Property"]; | ||
| 38 | |||
| 39 | if (null != propertyTable) | ||
| 40 | { | ||
| 41 | foreach (Row row in propertyTable.Rows) | ||
| 42 | { | ||
| 43 | if ("WixUI_Mode" == (string)row[0]) | ||
| 44 | { | ||
| 45 | Wix.UIRef uiRef = new Wix.UIRef(); | ||
| 46 | |||
| 47 | uiRef.Id = String.Concat("WixUI_", (string)row[1]); | ||
| 48 | |||
| 49 | this.Core.RootElement.AddChild(uiRef); | ||
| 50 | this.removeLibraryRows = true; | ||
| 51 | |||
| 52 | break; | ||
| 53 | } | ||
| 54 | } | ||
| 55 | } | ||
| 56 | } | ||
| 57 | } | ||
| 58 | #endif | ||
| 59 | } | ||
