From 155a6e96346e0cb3d9ab6f5372fa29b46ebaee89 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Tue, 19 Dec 2017 12:25:40 -0800 Subject: Integrate simplified message handling --- .../Bind/CreateIdtFileCommand.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/CreateIdtFileCommand.cs') diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateIdtFileCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateIdtFileCommand.cs index 1fc7d068..9afb3260 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateIdtFileCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateIdtFileCommand.cs @@ -8,17 +8,21 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.Text; using WixToolset.Data; using WixToolset.Data.WindowsInstaller; + using WixToolset.Extensibility.Services; internal class CreateIdtFileCommand { - public CreateIdtFileCommand(Table table, int codepage, string intermediateFolder, bool keepAddedColumns) + public CreateIdtFileCommand(IMessaging messaging, Table table, int codepage, string intermediateFolder, bool keepAddedColumns) { + this.Messaging = messaging; this.Table = table; this.Codepage = codepage; this.IntermediateFolder = intermediateFolder; this.KeepAddedColumns = keepAddedColumns; } + private IMessaging Messaging { get; } + private Table Table { get; } private int Codepage { get; set; } @@ -67,7 +71,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (TableDefinition.MaxColumnsInRealTable < table.Definition.Columns.Count) { - throw new WixException(WixDataErrors.TooManyColumnsInRealTable(table.Definition.Name, table.Definition.Columns.Count, TableDefinition.MaxColumnsInRealTable)); + throw new WixException(ErrorMessages.TooManyColumnsInRealTable(table.Definition.Name, table.Definition.Columns.Count, TableDefinition.MaxColumnsInRealTable)); } // Tack on the table header, and flush before we start writing bytes directly to the stream. @@ -98,7 +102,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } catch (EncoderFallbackException) { - Messaging.Instance.OnMessage(WixDataErrors.InvalidStringForCodepage(row.SourceLineNumbers, Convert.ToString(writer.Encoding.WindowsCodePage, CultureInfo.InvariantCulture))); + this.Messaging.Write(ErrorMessages.InvalidStringForCodepage(row.SourceLineNumbers, Convert.ToString(writer.Encoding.WindowsCodePage, CultureInfo.InvariantCulture))); rowBytes = convertEncoding.GetBytes(rowString); } -- cgit v1.2.3-55-g6feb