From 2bb37beda887d120a0ddabf874ad25357101faa1 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Wed, 1 Nov 2017 10:59:45 -0700 Subject: Update to WiX Intermediate Representation --- src/WixToolset.Core/DecompilerCore.cs | 152 ---------------------------------- 1 file changed, 152 deletions(-) delete mode 100644 src/WixToolset.Core/DecompilerCore.cs (limited to 'src/WixToolset.Core/DecompilerCore.cs') diff --git a/src/WixToolset.Core/DecompilerCore.cs b/src/WixToolset.Core/DecompilerCore.cs deleted file mode 100644 index 203f2bc4..00000000 --- a/src/WixToolset.Core/DecompilerCore.cs +++ /dev/null @@ -1,152 +0,0 @@ -// 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 -{ - using System; - using System.Collections; - using WixToolset.Data; - using WixToolset.Extensibility; - using Wix = WixToolset.Data.Serialize; - - /// - /// The base of the decompiler. Holds some variables used by the decompiler and extensions, - /// as well as some utility methods. - /// - internal class DecompilerCore : IDecompilerCore - { - private Hashtable elements; - private Wix.IParentElement rootElement; - private bool showPedanticMessages; - private Wix.UI uiElement; - - /// - /// Instantiate a new decompiler core. - /// - /// The root element of the decompiled database. - /// The message handler. - internal DecompilerCore(Wix.IParentElement rootElement) - { - this.elements = new Hashtable(); - this.rootElement = rootElement; - } - - /// - /// Gets whether the decompiler core encountered an error while processing. - /// - /// Flag if core encountered an error during processing. - public bool EncounteredError - { - get { return Messaging.Instance.EncounteredError; } - } - - /// - /// Gets the root element of the decompiled output. - /// - /// The root element of the decompiled output. - public Wix.IParentElement RootElement - { - get { return this.rootElement; } - } - - /// - /// Gets or sets the option to show pedantic messages. - /// - /// The option to show pedantic messages. - public bool ShowPedanticMessages - { - get { return this.showPedanticMessages; } - set { this.showPedanticMessages = value; } - } - - /// - /// Gets the UI element. - /// - /// The UI element. - public Wix.UI UIElement - { - get - { - if (null == this.uiElement) - { - this.uiElement = new Wix.UI(); - this.rootElement.AddChild(this.uiElement); - } - - return this.uiElement; - } - } - - /// - /// Verifies if a filename is a valid short filename. - /// - /// Filename to verify. - /// true if wildcards are allowed in the filename. - /// True if the filename is a valid short filename - public virtual bool IsValidShortFilename(string filename, bool allowWildcards) - { - return false; - } - - /// - /// Convert an Int32 into a DateTime. - /// - /// The Int32 value. - /// The DateTime. - public DateTime ConvertIntegerToDateTime(int value) - { - int date = value / 65536; - int time = value % 65536; - - return new DateTime(1980 + (date / 512), (date % 512) / 32, date % 32, time / 2048, (time % 2048) / 32, (time % 32) * 2); - } - - /// - /// Gets the element corresponding to the row it came from. - /// - /// The row corresponding to the element. - /// The indexed element. - public Wix.ISchemaElement GetIndexedElement(Row row) - { - return this.GetIndexedElement(row.TableDefinition.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter)); - } - - /// - /// Gets the element corresponding to the primary key of the given table. - /// - /// The table corresponding to the element. - /// The primary key corresponding to the element. - /// The indexed element. - public Wix.ISchemaElement GetIndexedElement(string table, params string[] primaryKey) - { - return (Wix.ISchemaElement)this.elements[String.Concat(table, ':', String.Join(DecompilerConstants.PrimaryKeyDelimiterString, primaryKey))]; - } - - /// - /// Index an element by its corresponding row. - /// - /// The row corresponding to the element. - /// The element to index. - public void IndexElement(Row row, Wix.ISchemaElement element) - { - this.elements.Add(String.Concat(row.TableDefinition.Name, ':', row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter)), element); - } - - /// - /// Indicates the decompiler encountered and unexpected table to decompile. - /// - /// Unknown decompiled table. - public void UnexpectedTable(Table table) - { - this.OnMessage(WixErrors.TableDecompilationUnimplemented(table.Name)); - } - - /// - /// Sends a message to the message delegate if there is one. - /// - /// Message event arguments. - public void OnMessage(MessageEventArgs e) - { - Messaging.Instance.OnMessage(e); - } - } -} -- cgit v1.2.3-55-g6feb