aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core/HarvesterCore.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2017-12-19 12:25:40 -0800
committerRob Mensching <rob@firegiant.com>2017-12-19 12:25:40 -0800
commit155a6e96346e0cb3d9ab6f5372fa29b46ebaee89 (patch)
tree59d1f151bfde8068b6014b05b5c8cfea3402c974 /src/WixToolset.Core/HarvesterCore.cs
parent6f1665ed759b31bd095f186f9239232c653597cd (diff)
downloadwix-155a6e96346e0cb3d9ab6f5372fa29b46ebaee89.tar.gz
wix-155a6e96346e0cb3d9ab6f5372fa29b46ebaee89.tar.bz2
wix-155a6e96346e0cb3d9ab6f5372fa29b46ebaee89.zip
Integrate simplified message handling
Diffstat (limited to 'src/WixToolset.Core/HarvesterCore.cs')
-rw-r--r--src/WixToolset.Core/HarvesterCore.cs39
1 files changed, 6 insertions, 33 deletions
diff --git a/src/WixToolset.Core/HarvesterCore.cs b/src/WixToolset.Core/HarvesterCore.cs
index 87e3c33f..92a057d8 100644
--- a/src/WixToolset.Core/HarvesterCore.cs
+++ b/src/WixToolset.Core/HarvesterCore.cs
@@ -5,44 +5,26 @@ namespace WixToolset.Core
5 using System; 5 using System;
6 using System.Diagnostics.CodeAnalysis; 6 using System.Diagnostics.CodeAnalysis;
7 using System.IO; 7 using System.IO;
8 using WixToolset.Data; 8 using WixToolset.Extensibility.Services;
9 9
10 /// <summary> 10 /// <summary>
11 /// The WiX Toolset harvester core. 11 /// The WiX Toolset harvester core.
12 /// </summary> 12 /// </summary>
13 public sealed class HarvesterCore : IHarvesterCore 13 public sealed class HarvesterCore : IHarvesterCore
14 { 14 {
15 private string extensionArgument; 15 public IMessaging Messaging { get; set; }
16 private string rootDirectory;
17
18 /// <summary>
19 /// Gets whether the harvester core encountered an error while processing.
20 /// </summary>
21 /// <value>Flag if core encountered an error during processing.</value>
22 public bool EncounteredError
23 {
24 get { return Messaging.Instance.EncounteredError; }
25 }
26 16
27 /// <summary> 17 /// <summary>
28 /// Gets or sets the value of the extension argument passed to heat. 18 /// Gets or sets the value of the extension argument passed to heat.
29 /// </summary> 19 /// </summary>
30 /// <value>The extension argument.</value> 20 /// <value>The extension argument.</value>
31 public string ExtensionArgument 21 public string ExtensionArgument { get; set; }
32 {
33 get { return this.extensionArgument; }
34 set { this.extensionArgument = value; }
35 }
36 22
37 /// <summary> 23 /// <summary>
38 /// Gets or sets the value of the root directory that is being harvested. 24 /// Gets or sets the value of the root directory that is being harvested.
39 /// </summary> 25 /// </summary>
40 /// <value>The root directory being harvested.</value> 26 /// <value>The root directory being harvested.</value>
41 public string RootDirectory 27 public string RootDirectory { get; set; }
42 {
43 get { return this.rootDirectory; }
44 set { this.rootDirectory = value; }
45 }
46 28
47 /// <summary> 29 /// <summary>
48 /// Create an identifier based on passed file name 30 /// Create an identifier based on passed file name
@@ -67,15 +49,6 @@ namespace WixToolset.Core
67 } 49 }
68 50
69 /// <summary> 51 /// <summary>
70 /// Sends a message to the message delegate if there is one.
71 /// </summary>
72 /// <param name="mea">Message event arguments.</param>
73 public void OnMessage(MessageEventArgs mea)
74 {
75 Messaging.Instance.OnMessage(mea);
76 }
77
78 /// <summary>
79 /// Resolves a file's path if the Wix.File.Source value starts with "SourceDir\". 52 /// Resolves a file's path if the Wix.File.Source value starts with "SourceDir\".
80 /// </summary> 53 /// </summary>
81 /// <param name="fileSource">The Wix.File.Source value with "SourceDir\".</param> 54 /// <param name="fileSource">The Wix.File.Source value with "SourceDir\".</param>
@@ -84,7 +57,7 @@ namespace WixToolset.Core
84 { 57 {
85 if (fileSource.StartsWith("SourceDir\\", StringComparison.Ordinal)) 58 if (fileSource.StartsWith("SourceDir\\", StringComparison.Ordinal))
86 { 59 {
87 string file = Path.GetFullPath(this.rootDirectory); 60 string file = Path.GetFullPath(this.RootDirectory);
88 if (File.Exists(file)) 61 if (File.Exists(file))
89 { 62 {
90 return file; 63 return file;
@@ -92,7 +65,7 @@ namespace WixToolset.Core
92 else 65 else
93 { 66 {
94 fileSource = fileSource.Substring(10); 67 fileSource = fileSource.Substring(10);
95 fileSource = Path.Combine(Path.GetFullPath(this.rootDirectory), fileSource); 68 fileSource = Path.Combine(Path.GetFullPath(this.RootDirectory), fileSource);
96 } 69 }
97 } 70 }
98 71