diff options
author | Rob Mensching <rob@firegiant.com> | 2017-12-19 12:25:40 -0800 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2017-12-19 12:25:40 -0800 |
commit | 155a6e96346e0cb3d9ab6f5372fa29b46ebaee89 (patch) | |
tree | 59d1f151bfde8068b6014b05b5c8cfea3402c974 /src/WixToolset.Core.WindowsInstaller/Bind/CreateIdtFileCommand.cs | |
parent | 6f1665ed759b31bd095f186f9239232c653597cd (diff) | |
download | wix-155a6e96346e0cb3d9ab6f5372fa29b46ebaee89.tar.gz wix-155a6e96346e0cb3d9ab6f5372fa29b46ebaee89.tar.bz2 wix-155a6e96346e0cb3d9ab6f5372fa29b46ebaee89.zip |
Integrate simplified message handling
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/CreateIdtFileCommand.cs')
-rw-r--r-- | src/WixToolset.Core.WindowsInstaller/Bind/CreateIdtFileCommand.cs | 10 |
1 files changed, 7 insertions, 3 deletions
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 | |||
8 | using System.Text; | 8 | using System.Text; |
9 | using WixToolset.Data; | 9 | using WixToolset.Data; |
10 | using WixToolset.Data.WindowsInstaller; | 10 | using WixToolset.Data.WindowsInstaller; |
11 | using WixToolset.Extensibility.Services; | ||
11 | 12 | ||
12 | internal class CreateIdtFileCommand | 13 | internal class CreateIdtFileCommand |
13 | { | 14 | { |
14 | public CreateIdtFileCommand(Table table, int codepage, string intermediateFolder, bool keepAddedColumns) | 15 | public CreateIdtFileCommand(IMessaging messaging, Table table, int codepage, string intermediateFolder, bool keepAddedColumns) |
15 | { | 16 | { |
17 | this.Messaging = messaging; | ||
16 | this.Table = table; | 18 | this.Table = table; |
17 | this.Codepage = codepage; | 19 | this.Codepage = codepage; |
18 | this.IntermediateFolder = intermediateFolder; | 20 | this.IntermediateFolder = intermediateFolder; |
19 | this.KeepAddedColumns = keepAddedColumns; | 21 | this.KeepAddedColumns = keepAddedColumns; |
20 | } | 22 | } |
21 | 23 | ||
24 | private IMessaging Messaging { get; } | ||
25 | |||
22 | private Table Table { get; } | 26 | private Table Table { get; } |
23 | 27 | ||
24 | private int Codepage { get; set; } | 28 | private int Codepage { get; set; } |
@@ -67,7 +71,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
67 | 71 | ||
68 | if (TableDefinition.MaxColumnsInRealTable < table.Definition.Columns.Count) | 72 | if (TableDefinition.MaxColumnsInRealTable < table.Definition.Columns.Count) |
69 | { | 73 | { |
70 | throw new WixException(WixDataErrors.TooManyColumnsInRealTable(table.Definition.Name, table.Definition.Columns.Count, TableDefinition.MaxColumnsInRealTable)); | 74 | throw new WixException(ErrorMessages.TooManyColumnsInRealTable(table.Definition.Name, table.Definition.Columns.Count, TableDefinition.MaxColumnsInRealTable)); |
71 | } | 75 | } |
72 | 76 | ||
73 | // Tack on the table header, and flush before we start writing bytes directly to the stream. | 77 | // 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 | |||
98 | } | 102 | } |
99 | catch (EncoderFallbackException) | 103 | catch (EncoderFallbackException) |
100 | { | 104 | { |
101 | Messaging.Instance.OnMessage(WixDataErrors.InvalidStringForCodepage(row.SourceLineNumbers, Convert.ToString(writer.Encoding.WindowsCodePage, CultureInfo.InvariantCulture))); | 105 | this.Messaging.Write(ErrorMessages.InvalidStringForCodepage(row.SourceLineNumbers, Convert.ToString(writer.Encoding.WindowsCodePage, CultureInfo.InvariantCulture))); |
102 | 106 | ||
103 | rowBytes = convertEncoding.GetBytes(rowString); | 107 | rowBytes = convertEncoding.GetBytes(rowString); |
104 | } | 108 | } |