aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Mba.Core/EventArgs.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Mba.Core/EventArgs.cs')
-rw-r--r--src/WixToolset.Mba.Core/EventArgs.cs143
1 files changed, 87 insertions, 56 deletions
diff --git a/src/WixToolset.Mba.Core/EventArgs.cs b/src/WixToolset.Mba.Core/EventArgs.cs
index 7e7cbd11..ee89b583 100644
--- a/src/WixToolset.Mba.Core/EventArgs.cs
+++ b/src/WixToolset.Mba.Core/EventArgs.cs
@@ -123,6 +123,31 @@ namespace WixToolset.Mba.Core
123 } 123 }
124 124
125 /// <summary> 125 /// <summary>
126 /// Base class for cancellable action BA <see cref="EventArgs"/> classes.
127 /// </summary>
128 [Serializable]
129 public abstract class CancellableActionEventArgs<T> : CancellableHResultEventArgs
130 {
131 /// <summary />
132 public CancellableActionEventArgs(bool cancelRecommendation, T recommendation, T action)
133 : base(cancelRecommendation)
134 {
135 this.Recommendation = recommendation;
136 this.Action = action;
137 }
138
139 /// <summary>
140 /// Gets the recommended action from the engine.
141 /// </summary>
142 public T Recommendation { get; private set; }
143
144 /// <summary>
145 /// Gets or sets the action to be performed. This is passed back to the engine.
146 /// </summary>
147 public T Action { get; set; }
148 }
149
150 /// <summary>
126 /// Additional arguments used when startup has begun. 151 /// Additional arguments used when startup has begun.
127 /// </summary> 152 /// </summary>
128 [Serializable] 153 [Serializable]
@@ -196,25 +221,26 @@ namespace WixToolset.Mba.Core
196 } 221 }
197 222
198 /// <summary> 223 /// <summary>
199 /// Additional arguments used when the overall detection phase has begun. 224 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectBegin"/>
200 /// </summary> 225 /// </summary>
201 [Serializable] 226 [Serializable]
202 public class DetectBeginEventArgs : CancellableHResultEventArgs 227 public class DetectBeginEventArgs : CancellableHResultEventArgs
203 { 228 {
204 /// <summary> 229 /// <summary />
205 /// Creates a new instance of the <see cref="DetectBeginEventArgs"/> class. 230 public DetectBeginEventArgs(bool cached, bool installed, int packageCount, bool cancelRecommendation)
206 /// </summary>
207 /// <param name="installed">Specifies whether the bundle is installed.</param>
208 /// <param name="packageCount">The number of packages to detect.</param>
209 /// <param name="cancelRecommendation">The recommendation from the engine.</param>
210 public DetectBeginEventArgs(bool installed, int packageCount, bool cancelRecommendation)
211 : base(cancelRecommendation) 231 : base(cancelRecommendation)
212 { 232 {
233 this.Cached = cached;
213 this.Installed = installed; 234 this.Installed = installed;
214 this.PackageCount = packageCount; 235 this.PackageCount = packageCount;
215 } 236 }
216 237
217 /// <summary> 238 /// <summary>
239 /// Gets whether the bundle is cached.
240 /// </summary>
241 public bool Cached { get; private set; }
242
243 /// <summary>
218 /// Gets whether the bundle is installed. 244 /// Gets whether the bundle is installed.
219 /// </summary> 245 /// </summary>
220 public bool Installed { get; private set; } 246 public bool Installed { get; private set; }
@@ -290,6 +316,7 @@ namespace WixToolset.Mba.Core
290 : base(cancelRecommendation) 316 : base(cancelRecommendation)
291 { 317 {
292 this.UpdateLocation = updateLocation; 318 this.UpdateLocation = updateLocation;
319 this.Skip = skipRecommendation;
293 } 320 }
294 321
295 /// <summary> 322 /// <summary>
@@ -1242,6 +1269,8 @@ namespace WixToolset.Mba.Core
1242 /// <param name="forceKeepRegistration"></param> 1269 /// <param name="forceKeepRegistration"></param>
1243 public UnregisterBeginEventArgs(bool keepRegistration, bool forceKeepRegistration) 1270 public UnregisterBeginEventArgs(bool keepRegistration, bool forceKeepRegistration)
1244 { 1271 {
1272 this.KeepRegistration = keepRegistration;
1273 this.ForceKeepRegistration = forceKeepRegistration;
1245 } 1274 }
1246 1275
1247 /// <summary> 1276 /// <summary>
@@ -1288,21 +1317,20 @@ namespace WixToolset.Mba.Core
1288 } 1317 }
1289 1318
1290 /// <summary> 1319 /// <summary>
1291 /// Additional arguments used when the engine begins to acquire containers or payloads. 1320 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheAcquireBegin"/>.
1292 /// </summary> 1321 /// </summary>
1293 [Serializable] 1322 [Serializable]
1294 public class CacheAcquireBeginEventArgs : CancellableHResultEventArgs 1323 public class CacheAcquireBeginEventArgs : CancellableActionEventArgs<CacheOperation>
1295 { 1324 {
1296 /// <summary> 1325 /// <summary />
1297 /// Creates a new instance of the <see cref="CacheAcquireBeginEventArgs"/> class. 1326 public CacheAcquireBeginEventArgs(string packageOrContainerId, string payloadId, string source, string downloadUrl, string payloadContainerId, CacheOperation recommendation, CacheOperation action, bool cancelRecommendation)
1298 /// </summary> 1327 : base(cancelRecommendation, recommendation, action)
1299 public CacheAcquireBeginEventArgs(string packageOrContainerId, string payloadId, CacheOperation operation, string source, bool cancelRecommendation)
1300 : base(cancelRecommendation)
1301 { 1328 {
1302 this.PackageOrContainerId = packageOrContainerId; 1329 this.PackageOrContainerId = packageOrContainerId;
1303 this.PayloadId = payloadId; 1330 this.PayloadId = payloadId;
1304 this.Operation = operation;
1305 this.Source = source; 1331 this.Source = source;
1332 this.DownloadUrl = downloadUrl;
1333 this.PayloadContainerId = payloadContainerId;
1306 } 1334 }
1307 1335
1308 /// <summary> 1336 /// <summary>
@@ -1316,25 +1344,28 @@ namespace WixToolset.Mba.Core
1316 public string PayloadId { get; private set; } 1344 public string PayloadId { get; private set; }
1317 1345
1318 /// <summary> 1346 /// <summary>
1319 /// Gets the cache acquire operation. 1347 /// Gets the source of the container or payload.
1320 /// </summary> 1348 /// </summary>
1321 public CacheOperation Operation { get; private set; } 1349 public string Source { get; private set; }
1322 1350
1323 /// <summary> 1351 /// <summary>
1324 /// Gets the source of the container or payload. 1352 /// Gets the optional URL to download container or payload.
1325 /// </summary> 1353 /// </summary>
1326 public string Source { get; private set; } 1354 public string DownloadUrl { get; private set; }
1355
1356 /// <summary>
1357 /// Gets the optional identity of the container that contains the payload being acquired.
1358 /// </summary>
1359 public string PayloadContainerId { get; private set; }
1327 } 1360 }
1328 1361
1329 /// <summary> 1362 /// <summary>
1330 /// Additional arguments used when the engine acquires some part of a container or payload. 1363 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheAcquireProgress"/>.
1331 /// </summary> 1364 /// </summary>
1332 [Serializable] 1365 [Serializable]
1333 public class CacheAcquireProgressEventArgs : CancellableHResultEventArgs 1366 public class CacheAcquireProgressEventArgs : CancellableHResultEventArgs
1334 { 1367 {
1335 /// <summary> 1368 /// <summary />
1336 /// Creates a new instance of the <see cref="CacheAcquireBeginEventArgs"/> class.
1337 /// </summary>
1338 public CacheAcquireProgressEventArgs(string packageOrContainerId, string payloadId, long progress, long total, int overallPercentage, bool cancelRecommendation) 1369 public CacheAcquireProgressEventArgs(string packageOrContainerId, string payloadId, long progress, long total, int overallPercentage, bool cancelRecommendation)
1339 : base(cancelRecommendation) 1370 : base(cancelRecommendation)
1340 { 1371 {
@@ -1372,14 +1403,12 @@ namespace WixToolset.Mba.Core
1372 } 1403 }
1373 1404
1374 /// <summary> 1405 /// <summary>
1375 /// Additional arguments used when the engine completes the acquisition of a container or payload. 1406 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheAcquireComplete"/>.
1376 /// </summary> 1407 /// </summary>
1377 [Serializable] 1408 [Serializable]
1378 public class CacheAcquireCompleteEventArgs : ActionEventArgs<BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION> 1409 public class CacheAcquireCompleteEventArgs : ActionEventArgs<BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION>
1379 { 1410 {
1380 /// <summary> 1411 /// <summary />
1381 /// Creates a new instance of the <see cref="CacheAcquireCompleteEventArgs"/> class.
1382 /// </summary>
1383 public CacheAcquireCompleteEventArgs(string packageOrContainerId, string payloadId, int hrStatus, BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION recommendation, BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION action) 1412 public CacheAcquireCompleteEventArgs(string packageOrContainerId, string payloadId, int hrStatus, BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION recommendation, BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION action)
1384 : base(hrStatus, recommendation, action) 1413 : base(hrStatus, recommendation, action)
1385 { 1414 {
@@ -1729,62 +1758,64 @@ namespace WixToolset.Mba.Core
1729 } 1758 }
1730 1759
1731 /// <summary> 1760 /// <summary>
1732 /// Additional arguments used by the engine to allow the BA to change the source 1761 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheAcquireResolving"/>.
1733 /// using <see cref="Engine.SetLocalSource"/> or <see cref="Engine.SetDownloadSource"/>.
1734 /// </summary> 1762 /// </summary>
1735 [Serializable] 1763 [Serializable]
1736 public class ResolveSourceEventArgs : CancellableHResultEventArgs 1764 public class CacheAcquireResolvingEventArgs : CancellableActionEventArgs<CacheResolveOperation>
1737 { 1765 {
1738 /// <summary> 1766 /// <summary />
1739 /// Creates a new instance of the <see cref="ResolveSourceEventArgs"/> class. 1767 public CacheAcquireResolvingEventArgs(string packageOrContainerId, string payloadId, string[] searchPaths, bool foundLocal, int recommendedSearchPath, string downloadUrl, string payloadContainerId, CacheResolveOperation recommendation, int chosenSearchPath, CacheResolveOperation action, bool cancel)
1740 /// </summary> 1768 : base(cancel, recommendation, action)
1741 /// <param name="packageOrContainerId">The identity of the package or container that requires source.</param>
1742 /// <param name="payloadId">The identity of the payload that requires source.</param>
1743 /// <param name="localSource">The current path used for source resolution.</param>
1744 /// <param name="downloadSource">Optional URL to download container or payload.</param>
1745 /// <param name="recommendation">The recommended action from the engine.</param>
1746 /// <param name="action">The action to perform.</param>
1747 /// <param name="cancelRecommendation">The recommendation from the engine.</param>
1748 public ResolveSourceEventArgs(string packageOrContainerId, string payloadId, string localSource, string downloadSource, BOOTSTRAPPER_RESOLVESOURCE_ACTION recommendation, BOOTSTRAPPER_RESOLVESOURCE_ACTION action, bool cancelRecommendation)
1749 : base(cancelRecommendation)
1750 { 1769 {
1751 this.PackageOrContainerId = packageOrContainerId; 1770 this.PackageOrContainerId = packageOrContainerId;
1752 this.PayloadId = payloadId; 1771 this.PayloadId = payloadId;
1753 this.LocalSource = localSource; 1772 this.SearchPaths = searchPaths;
1754 this.DownloadSource = downloadSource; 1773 this.FoundLocal = foundLocal;
1755 this.Recommendation = recommendation; 1774 this.RecommendedSearchPath = recommendedSearchPath;
1756 this.Action = action; 1775 this.DownloadUrl = downloadUrl;
1776 this.PayloadContainerId = payloadContainerId;
1777 this.ChosenSearchPath = chosenSearchPath;
1757 } 1778 }
1758 1779
1759 /// <summary> 1780 /// <summary>
1760 /// Gets the identity of the package or container that requires source. 1781 /// Gets the identity of the package or container that is being acquired.
1761 /// </summary> 1782 /// </summary>
1762 public string PackageOrContainerId { get; private set; } 1783 public string PackageOrContainerId { get; private set; }
1763 1784
1764 /// <summary> 1785 /// <summary>
1765 /// Gets the identity of the payload that requires source. 1786 /// Gets the identity of the payload that is being acquired.
1766 /// </summary> 1787 /// </summary>
1767 public string PayloadId { get; private set; } 1788 public string PayloadId { get; private set; }
1768 1789
1769 /// <summary> 1790 /// <summary>
1770 /// Gets the current path used for source resolution. 1791 /// Gets the search paths used for source resolution.
1771 /// </summary> 1792 /// </summary>
1772 public string LocalSource { get; private set; } 1793 public string[] SearchPaths { get; private set; }
1794
1795 /// <summary>
1796 /// Gets whether <see cref="RecommendedSearchPath"/> indicates that a file was found at that search path.
1797 /// </summary>
1798 public bool FoundLocal { get; private set; }
1799
1800 /// <summary>
1801 /// When <see cref="FoundLocal"/> is true, the index to <see cref="SearchPaths"/> for the recommended local file.
1802 /// </summary>
1803 public int RecommendedSearchPath { get; private set; }
1773 1804
1774 /// <summary> 1805 /// <summary>
1775 /// Gets the optional URL to download container or payload. 1806 /// Gets the optional URL to download container or payload.
1776 /// </summary> 1807 /// </summary>
1777 public string DownloadSource { get; private set; } 1808 public string DownloadUrl { get; private set; }
1778 1809
1779 /// <summary> 1810 /// <summary>
1780 /// Gets the recommended action from the engine. 1811 /// Gets the optional identity of the container that contains the payload being acquired.
1781 /// </summary> 1812 /// </summary>
1782 public BOOTSTRAPPER_RESOLVESOURCE_ACTION Recommendation { get; private set; } 1813 public string PayloadContainerId { get; private set; }
1783 1814
1784 /// <summary> 1815 /// <summary>
1785 /// Gets or sets the action to perform. 1816 /// Gets or sets the index to <see cref="SearchPaths"/> to use when <see cref="CancellableActionEventArgs{T}.Action"/> is set to <see cref="CacheOperation.Copy"/>.
1786 /// </summary> 1817 /// </summary>
1787 public BOOTSTRAPPER_RESOLVESOURCE_ACTION Action { get; set; } 1818 public int ChosenSearchPath { get; set; }
1788 } 1819 }
1789 1820
1790 /// <summary> 1821 /// <summary>