diff options
Diffstat (limited to 'src/api/burn/WixToolset.Mba.Core/EventArgs.cs')
-rw-r--r-- | src/api/burn/WixToolset.Mba.Core/EventArgs.cs | 2186 |
1 files changed, 2186 insertions, 0 deletions
diff --git a/src/api/burn/WixToolset.Mba.Core/EventArgs.cs b/src/api/burn/WixToolset.Mba.Core/EventArgs.cs new file mode 100644 index 00000000..8ef8af14 --- /dev/null +++ b/src/api/burn/WixToolset.Mba.Core/EventArgs.cs | |||
@@ -0,0 +1,2186 @@ | |||
1 | // 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. | ||
2 | |||
3 | namespace WixToolset.Mba.Core | ||
4 | { | ||
5 | using System; | ||
6 | using System.Collections.Generic; | ||
7 | using System.Collections.ObjectModel; | ||
8 | |||
9 | /// <summary> | ||
10 | /// Base class for BA <see cref="EventArgs"/> classes. | ||
11 | /// </summary> | ||
12 | [Serializable] | ||
13 | public abstract class HResultEventArgs : EventArgs | ||
14 | { | ||
15 | /// <summary> | ||
16 | /// Creates a new instance of the <see cref="HResultEventArgs"/> class. | ||
17 | /// </summary> | ||
18 | public HResultEventArgs() | ||
19 | { | ||
20 | } | ||
21 | |||
22 | /// <summary> | ||
23 | /// Gets or sets the <see cref="HResult"/> of the operation. This is passed back to the engine. | ||
24 | /// </summary> | ||
25 | public int HResult { get; set; } | ||
26 | } | ||
27 | |||
28 | /// <summary> | ||
29 | /// Base class for cancellable BA <see cref="EventArgs"/> classes. | ||
30 | /// </summary> | ||
31 | [Serializable] | ||
32 | public abstract class CancellableHResultEventArgs : HResultEventArgs | ||
33 | { | ||
34 | /// <summary> | ||
35 | /// Creates a new instance of the <see cref="CancellableHResultEventArgs"/> class. | ||
36 | /// </summary> | ||
37 | public CancellableHResultEventArgs(bool cancelRecommendation) | ||
38 | { | ||
39 | this.Cancel = cancelRecommendation; | ||
40 | } | ||
41 | |||
42 | /// <summary> | ||
43 | /// Gets or sets whether to cancel the operation. This is passed back to the engine. | ||
44 | /// </summary> | ||
45 | public bool Cancel { get; set; } | ||
46 | } | ||
47 | |||
48 | /// <summary> | ||
49 | /// Base class for <see cref="EventArgs"/> classes that must return a <see cref="Result"/>. | ||
50 | /// </summary> | ||
51 | [Serializable] | ||
52 | public abstract class ResultEventArgs : HResultEventArgs | ||
53 | { | ||
54 | /// <summary /> | ||
55 | public ResultEventArgs(Result recommendation, Result result) | ||
56 | { | ||
57 | this.Recommendation = recommendation; | ||
58 | this.Result = result; | ||
59 | } | ||
60 | |||
61 | /// <summary> | ||
62 | /// Gets the recommended <see cref="Result"/> of the operation. | ||
63 | /// </summary> | ||
64 | public Result Recommendation { get; private set; } | ||
65 | |||
66 | /// <summary> | ||
67 | /// Gets or sets the <see cref="Result"/> of the operation. This is passed back to the engine. | ||
68 | /// </summary> | ||
69 | public Result Result { get; set; } | ||
70 | } | ||
71 | |||
72 | /// <summary> | ||
73 | /// Base class for <see cref="EventArgs"/> classes that receive status from the engine. | ||
74 | /// </summary> | ||
75 | [Serializable] | ||
76 | public abstract class StatusEventArgs : HResultEventArgs | ||
77 | { | ||
78 | /// <summary> | ||
79 | /// Creates a new instance of the <see cref="StatusEventArgs"/> class. | ||
80 | /// </summary> | ||
81 | /// <param name="hrStatus">The return code of the operation.</param> | ||
82 | public StatusEventArgs(int hrStatus) | ||
83 | { | ||
84 | this.Status = hrStatus; | ||
85 | } | ||
86 | |||
87 | /// <summary> | ||
88 | /// Gets the return code of the operation. | ||
89 | /// </summary> | ||
90 | public int Status { get; private set; } | ||
91 | } | ||
92 | |||
93 | /// <summary> | ||
94 | /// Base class for <see cref="EventArgs"/> classes that receive status from the engine and return an action. | ||
95 | /// </summary> | ||
96 | public abstract class ActionEventArgs<T> : StatusEventArgs | ||
97 | { | ||
98 | /// <summary /> | ||
99 | public ActionEventArgs(int hrStatus, T recommendation, T action) | ||
100 | : base(hrStatus) | ||
101 | { | ||
102 | this.Recommendation = recommendation; | ||
103 | this.Action = action; | ||
104 | } | ||
105 | |||
106 | /// <summary> | ||
107 | /// Gets the recommended action from the engine. | ||
108 | /// </summary> | ||
109 | public T Recommendation { get; private set; } | ||
110 | |||
111 | /// <summary> | ||
112 | /// Gets or sets the action to be performed. This is passed back to the engine. | ||
113 | /// </summary> | ||
114 | public T Action { get; set; } | ||
115 | } | ||
116 | |||
117 | /// <summary> | ||
118 | /// Base class for cancellable action BA <see cref="EventArgs"/> classes. | ||
119 | /// </summary> | ||
120 | [Serializable] | ||
121 | public abstract class CancellableActionEventArgs<T> : CancellableHResultEventArgs | ||
122 | { | ||
123 | /// <summary /> | ||
124 | public CancellableActionEventArgs(bool cancelRecommendation, T recommendation, T action) | ||
125 | : base(cancelRecommendation) | ||
126 | { | ||
127 | this.Recommendation = recommendation; | ||
128 | this.Action = action; | ||
129 | } | ||
130 | |||
131 | /// <summary> | ||
132 | /// Gets the recommended action from the engine. | ||
133 | /// </summary> | ||
134 | public T Recommendation { get; private set; } | ||
135 | |||
136 | /// <summary> | ||
137 | /// Gets or sets the action to be performed. This is passed back to the engine. | ||
138 | /// </summary> | ||
139 | public T Action { get; set; } | ||
140 | } | ||
141 | |||
142 | /// <summary> | ||
143 | /// Base class for cache progress events. | ||
144 | /// </summary> | ||
145 | [Serializable] | ||
146 | public abstract class CacheProgressBaseEventArgs : CancellableHResultEventArgs | ||
147 | { | ||
148 | /// <summary /> | ||
149 | public CacheProgressBaseEventArgs(string packageOrContainerId, string payloadId, long progress, long total, int overallPercentage, bool cancelRecommendation) | ||
150 | : base(cancelRecommendation) | ||
151 | { | ||
152 | this.PackageOrContainerId = packageOrContainerId; | ||
153 | this.PayloadId = payloadId; | ||
154 | this.Progress = progress; | ||
155 | this.Total = total; | ||
156 | this.OverallPercentage = overallPercentage; | ||
157 | } | ||
158 | |||
159 | /// <summary> | ||
160 | /// Gets the identifier of the container or package. | ||
161 | /// </summary> | ||
162 | public string PackageOrContainerId { get; private set; } | ||
163 | |||
164 | /// <summary> | ||
165 | /// Gets the identifier of the payload. | ||
166 | /// </summary> | ||
167 | public string PayloadId { get; private set; } | ||
168 | |||
169 | /// <summary> | ||
170 | /// Gets the number of bytes cached thus far. | ||
171 | /// </summary> | ||
172 | public long Progress { get; private set; } | ||
173 | |||
174 | /// <summary> | ||
175 | /// Gets the total bytes to cache. | ||
176 | /// </summary> | ||
177 | public long Total { get; private set; } | ||
178 | |||
179 | /// <summary> | ||
180 | /// Gets the overall percentage of progress of caching. | ||
181 | /// </summary> | ||
182 | public int OverallPercentage { get; private set; } | ||
183 | } | ||
184 | |||
185 | /// <summary> | ||
186 | /// Additional arguments used when startup has begun. | ||
187 | /// </summary> | ||
188 | [Serializable] | ||
189 | public class StartupEventArgs : HResultEventArgs | ||
190 | { | ||
191 | /// <summary> | ||
192 | /// Creates a new instance of the <see cref="StartupEventArgs"/> class. | ||
193 | /// </summary> | ||
194 | public StartupEventArgs() | ||
195 | { | ||
196 | } | ||
197 | } | ||
198 | |||
199 | /// <summary> | ||
200 | /// Additional arguments used when shutdown has begun. | ||
201 | /// </summary> | ||
202 | [Serializable] | ||
203 | public class ShutdownEventArgs : HResultEventArgs | ||
204 | { | ||
205 | /// <summary> | ||
206 | /// Creates a new instance of the <see cref="ShutdownEventArgs"/> class. | ||
207 | /// </summary> | ||
208 | public ShutdownEventArgs(BOOTSTRAPPER_SHUTDOWN_ACTION action) | ||
209 | { | ||
210 | this.Action = action; | ||
211 | } | ||
212 | |||
213 | /// <summary> | ||
214 | /// The action for OnShutdown. | ||
215 | /// </summary> | ||
216 | public BOOTSTRAPPER_SHUTDOWN_ACTION Action { get; set; } | ||
217 | } | ||
218 | |||
219 | /// <summary> | ||
220 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.SystemShutdown"/> | ||
221 | /// </summary> | ||
222 | [Serializable] | ||
223 | public class SystemShutdownEventArgs : CancellableHResultEventArgs | ||
224 | { | ||
225 | /// <summary /> | ||
226 | public SystemShutdownEventArgs(EndSessionReasons reasons, bool cancelRecommendation) | ||
227 | : base(cancelRecommendation) | ||
228 | { | ||
229 | this.Reasons = reasons; | ||
230 | } | ||
231 | |||
232 | /// <summary> | ||
233 | /// Gets the reason the application is requested to close or being closed. | ||
234 | /// </summary> | ||
235 | /// <remarks> | ||
236 | /// <para>To prevent shutting down or logging off, set <see cref="CancellableHResultEventArgs.Cancel"/> to | ||
237 | /// true; otherwise, set it to false.</para> | ||
238 | /// <para>If <see cref="SystemShutdownEventArgs.Reasons"/> contains <see cref="EndSessionReasons.Critical"/> | ||
239 | /// the bootstrapper cannot prevent the shutdown and only has a few seconds to save state or perform any other | ||
240 | /// critical operations before being closed by the operating system.</para> | ||
241 | /// </remarks> | ||
242 | public EndSessionReasons Reasons { get; private set; } | ||
243 | } | ||
244 | |||
245 | /// <summary> | ||
246 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectBegin"/> | ||
247 | /// </summary> | ||
248 | [Serializable] | ||
249 | public class DetectBeginEventArgs : CancellableHResultEventArgs | ||
250 | { | ||
251 | /// <summary /> | ||
252 | public DetectBeginEventArgs(bool cached, bool installed, int packageCount, bool cancelRecommendation) | ||
253 | : base(cancelRecommendation) | ||
254 | { | ||
255 | this.Cached = cached; | ||
256 | this.Installed = installed; | ||
257 | this.PackageCount = packageCount; | ||
258 | } | ||
259 | |||
260 | /// <summary> | ||
261 | /// Gets whether the bundle is cached. | ||
262 | /// </summary> | ||
263 | public bool Cached { get; private set; } | ||
264 | |||
265 | /// <summary> | ||
266 | /// Gets whether the bundle is installed. | ||
267 | /// </summary> | ||
268 | public bool Installed { get; private set; } | ||
269 | |||
270 | /// <summary> | ||
271 | /// Gets the number of packages to detect. | ||
272 | /// </summary> | ||
273 | public int PackageCount { get; private set; } | ||
274 | } | ||
275 | |||
276 | /// <summary> | ||
277 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectForwardCompatibleBundle"/> | ||
278 | /// </summary> | ||
279 | [Serializable] | ||
280 | public class DetectForwardCompatibleBundleEventArgs : CancellableHResultEventArgs | ||
281 | { | ||
282 | /// <summary /> | ||
283 | public DetectForwardCompatibleBundleEventArgs(string bundleId, RelationType relationType, string bundleTag, bool perMachine, string version, bool missingFromCache, bool cancelRecommendation) | ||
284 | : base(cancelRecommendation) | ||
285 | { | ||
286 | this.BundleId = bundleId; | ||
287 | this.RelationType = relationType; | ||
288 | this.BundleTag = bundleTag; | ||
289 | this.PerMachine = perMachine; | ||
290 | this.Version = version; | ||
291 | this.MissingFromCache = missingFromCache; | ||
292 | } | ||
293 | |||
294 | /// <summary> | ||
295 | /// Gets the identity of the forward compatible bundle detected. | ||
296 | /// </summary> | ||
297 | public string BundleId { get; private set; } | ||
298 | |||
299 | /// <summary> | ||
300 | /// Gets the relationship type of the forward compatible bundle. | ||
301 | /// </summary> | ||
302 | public RelationType RelationType { get; private set; } | ||
303 | |||
304 | /// <summary> | ||
305 | /// Gets the tag of the forward compatible bundle. | ||
306 | /// </summary> | ||
307 | public string BundleTag { get; private set; } | ||
308 | |||
309 | /// <summary> | ||
310 | /// Gets whether the detected forward compatible bundle is per machine. | ||
311 | /// </summary> | ||
312 | public bool PerMachine { get; private set; } | ||
313 | |||
314 | /// <summary> | ||
315 | /// Gets the version of the forward compatible bundle detected. | ||
316 | /// </summary> | ||
317 | public string Version { get; private set; } | ||
318 | |||
319 | /// <summary> | ||
320 | /// Whether the forward compatible bundle is missing from the package cache. | ||
321 | /// </summary> | ||
322 | public bool MissingFromCache { get; set; } | ||
323 | } | ||
324 | |||
325 | /// <summary> | ||
326 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectUpdateBegin"/> | ||
327 | /// </summary> | ||
328 | [Serializable] | ||
329 | public class DetectUpdateBeginEventArgs : CancellableHResultEventArgs | ||
330 | { | ||
331 | /// <summary /> | ||
332 | public DetectUpdateBeginEventArgs(string updateLocation, bool cancelRecommendation, bool skipRecommendation) | ||
333 | : base(cancelRecommendation) | ||
334 | { | ||
335 | this.UpdateLocation = updateLocation; | ||
336 | this.Skip = skipRecommendation; | ||
337 | } | ||
338 | |||
339 | /// <summary> | ||
340 | /// Gets the identity of the bundle to detect. | ||
341 | /// </summary> | ||
342 | public string UpdateLocation { get; private set; } | ||
343 | |||
344 | /// <summary> | ||
345 | /// Whether to skip checking for bundle updates. | ||
346 | /// </summary> | ||
347 | public bool Skip { get; set; } | ||
348 | } | ||
349 | |||
350 | /// <summary> | ||
351 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectUpdate"/> | ||
352 | /// </summary> | ||
353 | [Serializable] | ||
354 | public class DetectUpdateEventArgs : CancellableHResultEventArgs | ||
355 | { | ||
356 | /// <summary /> | ||
357 | public DetectUpdateEventArgs(string updateLocation, long size, string version, string title, string summary, string contentType, string content, bool cancelRecommendation, bool stopRecommendation) | ||
358 | : base(cancelRecommendation) | ||
359 | { | ||
360 | this.UpdateLocation = updateLocation; | ||
361 | this.Size = size; | ||
362 | this.Version = version; | ||
363 | this.Title = title; | ||
364 | this.Summary = summary; | ||
365 | this.ContentType = contentType; | ||
366 | this.Content = content; | ||
367 | this.StopProcessingUpdates = stopRecommendation; | ||
368 | } | ||
369 | |||
370 | /// <summary> | ||
371 | /// Gets the identity of the bundle to detect. | ||
372 | /// </summary> | ||
373 | public string UpdateLocation { get; private set; } | ||
374 | |||
375 | /// <summary> | ||
376 | /// Gets the size of the updated bundle. | ||
377 | /// </summary> | ||
378 | public long Size { get; private set; } | ||
379 | |||
380 | /// <summary> | ||
381 | /// Gets the version of the updated bundle. | ||
382 | /// </summary> | ||
383 | public string Version { get; private set; } | ||
384 | |||
385 | /// <summary> | ||
386 | /// Gets the title of the the updated bundle. | ||
387 | /// </summary> | ||
388 | public string Title { get; private set; } | ||
389 | |||
390 | /// <summary> | ||
391 | /// Gets the summary of the updated bundle. | ||
392 | /// </summary> | ||
393 | public string Summary { get; private set; } | ||
394 | |||
395 | /// <summary> | ||
396 | /// Gets the content type of the content of the updated bundle. | ||
397 | /// </summary> | ||
398 | public string ContentType { get; private set; } | ||
399 | |||
400 | /// <summary> | ||
401 | /// Gets the content of the updated bundle. | ||
402 | /// </summary> | ||
403 | public string Content { get; private set; } | ||
404 | |||
405 | /// <summary> | ||
406 | /// Tells the engine to stop giving the rest of the updates found in the feed. | ||
407 | /// </summary> | ||
408 | public bool StopProcessingUpdates { get; set; } | ||
409 | } | ||
410 | |||
411 | /// <summary> | ||
412 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectUpdateComplete"/> | ||
413 | /// </summary> | ||
414 | [Serializable] | ||
415 | public class DetectUpdateCompleteEventArgs : StatusEventArgs | ||
416 | { | ||
417 | /// <summary /> | ||
418 | public DetectUpdateCompleteEventArgs(int hrStatus, bool ignoreRecommendation) | ||
419 | : base(hrStatus) | ||
420 | { | ||
421 | this.IgnoreError = ignoreRecommendation; | ||
422 | } | ||
423 | |||
424 | /// <summary> | ||
425 | /// If Status is an error, then set this to true to ignore it and continue detecting. | ||
426 | /// </summary> | ||
427 | public bool IgnoreError { get; set; } | ||
428 | } | ||
429 | |||
430 | /// <summary> | ||
431 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectRelatedBundle"/> | ||
432 | /// </summary> | ||
433 | [Serializable] | ||
434 | public class DetectRelatedBundleEventArgs : CancellableHResultEventArgs | ||
435 | { | ||
436 | /// <summary /> | ||
437 | public DetectRelatedBundleEventArgs(string productCode, RelationType relationType, string bundleTag, bool perMachine, string version, RelatedOperation operation, bool missingFromCache, bool cancelRecommendation) | ||
438 | : base(cancelRecommendation) | ||
439 | { | ||
440 | this.ProductCode = productCode; | ||
441 | this.RelationType = relationType; | ||
442 | this.BundleTag = bundleTag; | ||
443 | this.PerMachine = perMachine; | ||
444 | this.Version = version; | ||
445 | this.Operation = operation; | ||
446 | this.MissingFromCache = missingFromCache; | ||
447 | } | ||
448 | |||
449 | /// <summary> | ||
450 | /// Gets the identity of the related bundle detected. | ||
451 | /// </summary> | ||
452 | public string ProductCode { get; private set; } | ||
453 | |||
454 | /// <summary> | ||
455 | /// Gets the relationship type of the related bundle. | ||
456 | /// </summary> | ||
457 | public RelationType RelationType { get; private set; } | ||
458 | |||
459 | /// <summary> | ||
460 | /// Gets the tag of the related package bundle. | ||
461 | /// </summary> | ||
462 | public string BundleTag { get; private set; } | ||
463 | |||
464 | /// <summary> | ||
465 | /// Gets whether the detected bundle is per machine. | ||
466 | /// </summary> | ||
467 | public bool PerMachine { get; private set; } | ||
468 | |||
469 | /// <summary> | ||
470 | /// Gets the version of the related bundle detected. | ||
471 | /// </summary> | ||
472 | public string Version { get; private set; } | ||
473 | |||
474 | /// <summary> | ||
475 | /// Gets the operation that will be taken on the detected bundle. | ||
476 | /// </summary> | ||
477 | public RelatedOperation Operation { get; private set; } | ||
478 | |||
479 | /// <summary> | ||
480 | /// Whether the related bundle is missing from the package cache. | ||
481 | /// </summary> | ||
482 | public bool MissingFromCache { get; set; } | ||
483 | } | ||
484 | |||
485 | /// <summary> | ||
486 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectPackageBegin"/> | ||
487 | /// </summary> | ||
488 | [Serializable] | ||
489 | public class DetectPackageBeginEventArgs : CancellableHResultEventArgs | ||
490 | { | ||
491 | /// <summary /> | ||
492 | public DetectPackageBeginEventArgs(string packageId, bool cancelRecommendation) | ||
493 | : base(cancelRecommendation) | ||
494 | { | ||
495 | this.PackageId = packageId; | ||
496 | } | ||
497 | |||
498 | /// <summary> | ||
499 | /// Gets the identity of the package to detect. | ||
500 | /// </summary> | ||
501 | public string PackageId { get; private set; } | ||
502 | } | ||
503 | |||
504 | /// <summary> | ||
505 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectRelatedMsiPackage"/> | ||
506 | /// </summary> | ||
507 | [Serializable] | ||
508 | public class DetectRelatedMsiPackageEventArgs : CancellableHResultEventArgs | ||
509 | { | ||
510 | /// <summary /> | ||
511 | public DetectRelatedMsiPackageEventArgs(string packageId, string upgradeCode, string productCode, bool perMachine, string version, RelatedOperation operation, bool cancelRecommendation) | ||
512 | : base(cancelRecommendation) | ||
513 | { | ||
514 | this.PackageId = packageId; | ||
515 | this.UpgradeCode = upgradeCode; | ||
516 | this.ProductCode = productCode; | ||
517 | this.PerMachine = perMachine; | ||
518 | this.Version = version; | ||
519 | this.Operation = operation; | ||
520 | } | ||
521 | |||
522 | /// <summary> | ||
523 | /// Gets the identity of the product's package detected. | ||
524 | /// </summary> | ||
525 | public string PackageId { get; private set; } | ||
526 | |||
527 | /// <summary> | ||
528 | /// Gets the upgrade code of the related package detected. | ||
529 | /// </summary> | ||
530 | public string UpgradeCode { get; private set; } | ||
531 | |||
532 | /// <summary> | ||
533 | /// Gets the identity of the related package detected. | ||
534 | /// </summary> | ||
535 | public string ProductCode { get; private set; } | ||
536 | |||
537 | /// <summary> | ||
538 | /// Gets whether the detected package is per machine. | ||
539 | /// </summary> | ||
540 | public bool PerMachine { get; private set; } | ||
541 | |||
542 | /// <summary> | ||
543 | /// Gets the version of the related package detected. | ||
544 | /// </summary> | ||
545 | public string Version { get; private set; } | ||
546 | |||
547 | /// <summary> | ||
548 | /// Gets the operation that will be taken on the detected package. | ||
549 | /// </summary> | ||
550 | public RelatedOperation Operation { get; private set; } | ||
551 | } | ||
552 | |||
553 | /// <summary> | ||
554 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectPatchTarget"/> | ||
555 | /// </summary> | ||
556 | public class DetectPatchTargetEventArgs : CancellableHResultEventArgs | ||
557 | { | ||
558 | /// <summary> | ||
559 | /// | ||
560 | /// </summary> | ||
561 | /// <param name="packageId"></param> | ||
562 | /// <param name="productCode"></param> | ||
563 | /// <param name="state"></param> | ||
564 | /// <param name="cancelRecommendation"></param> | ||
565 | public DetectPatchTargetEventArgs(string packageId, string productCode, PackageState state, bool cancelRecommendation) | ||
566 | : base(cancelRecommendation) | ||
567 | { | ||
568 | this.PackageId = packageId; | ||
569 | this.ProductCode = productCode; | ||
570 | this.State = state; | ||
571 | } | ||
572 | |||
573 | /// <summary> | ||
574 | /// Gets the identity of the patch's package. | ||
575 | /// </summary> | ||
576 | public string PackageId { get; private set; } | ||
577 | |||
578 | /// <summary> | ||
579 | /// Gets the product code of the target. | ||
580 | /// </summary> | ||
581 | public string ProductCode { get; private set; } | ||
582 | |||
583 | /// <summary> | ||
584 | /// Gets the detected patch state for the target. | ||
585 | /// </summary> | ||
586 | public PackageState State { get; private set; } | ||
587 | } | ||
588 | |||
589 | /// <summary> | ||
590 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectMsiFeature"/> | ||
591 | /// </summary> | ||
592 | public class DetectMsiFeatureEventArgs : CancellableHResultEventArgs | ||
593 | { | ||
594 | /// <summary /> | ||
595 | public DetectMsiFeatureEventArgs(string packageId, string featureId, FeatureState state, bool cancelRecommendation) | ||
596 | : base(cancelRecommendation) | ||
597 | { | ||
598 | this.PackageId = packageId; | ||
599 | this.FeatureId = featureId; | ||
600 | this.State = state; | ||
601 | } | ||
602 | |||
603 | /// <summary> | ||
604 | /// Gets the identity of the feature's package detected. | ||
605 | /// </summary> | ||
606 | public string PackageId { get; private set; } | ||
607 | |||
608 | /// <summary> | ||
609 | /// Gets the identity of the feature detected. | ||
610 | /// </summary> | ||
611 | public string FeatureId { get; private set; } | ||
612 | |||
613 | /// <summary> | ||
614 | /// Gets the detected feature state. | ||
615 | /// </summary> | ||
616 | public FeatureState State { get; private set; } | ||
617 | } | ||
618 | |||
619 | /// <summary> | ||
620 | /// Additional arguments for <see cref="IDefaultBootstrapperApplication.DetectPackageComplete"/>. | ||
621 | /// </summary> | ||
622 | [Serializable] | ||
623 | public class DetectPackageCompleteEventArgs : StatusEventArgs | ||
624 | { | ||
625 | /// <summary /> | ||
626 | public DetectPackageCompleteEventArgs(string packageId, int hrStatus, PackageState state, bool cached) | ||
627 | : base(hrStatus) | ||
628 | { | ||
629 | this.PackageId = packageId; | ||
630 | this.State = state; | ||
631 | this.Cached = cached; | ||
632 | } | ||
633 | |||
634 | /// <summary> | ||
635 | /// Gets the identity of the package detected. | ||
636 | /// </summary> | ||
637 | public string PackageId { get; private set; } | ||
638 | |||
639 | /// <summary> | ||
640 | /// Gets the state of the specified package. | ||
641 | /// </summary> | ||
642 | public PackageState State { get; private set; } | ||
643 | |||
644 | /// <summary> | ||
645 | /// Gets whether any part of the package is cached. | ||
646 | /// </summary> | ||
647 | public bool Cached { get; private set; } | ||
648 | } | ||
649 | |||
650 | /// <summary> | ||
651 | /// Additional arguments used when the detection phase has completed. | ||
652 | /// </summary> | ||
653 | [Serializable] | ||
654 | public class DetectCompleteEventArgs : StatusEventArgs | ||
655 | { | ||
656 | /// <summary> | ||
657 | /// Creates a new instance of the <see cref="DetectCompleteEventArgs"/> class. | ||
658 | /// </summary> | ||
659 | /// <param name="hrStatus">The return code of the operation.</param> | ||
660 | /// <param name="eligibleForCleanup"></param> | ||
661 | public DetectCompleteEventArgs(int hrStatus, bool eligibleForCleanup) | ||
662 | : base(hrStatus) | ||
663 | { | ||
664 | this.EligibleForCleanup = eligibleForCleanup; | ||
665 | } | ||
666 | |||
667 | /// <summary> | ||
668 | /// Indicates whether the engine will uninstall the bundle if shutdown without running Apply. | ||
669 | /// </summary> | ||
670 | public bool EligibleForCleanup { get; private set; } | ||
671 | } | ||
672 | |||
673 | /// <summary> | ||
674 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanBegin"/> | ||
675 | /// </summary> | ||
676 | [Serializable] | ||
677 | public class PlanBeginEventArgs : CancellableHResultEventArgs | ||
678 | { | ||
679 | /// <summary /> | ||
680 | public PlanBeginEventArgs(int packageCount, bool cancelRecommendation) | ||
681 | : base(cancelRecommendation) | ||
682 | { | ||
683 | this.PackageCount = packageCount; | ||
684 | } | ||
685 | |||
686 | /// <summary> | ||
687 | /// Gets the number of packages to plan for. | ||
688 | /// </summary> | ||
689 | public int PackageCount { get; private set; } | ||
690 | } | ||
691 | |||
692 | /// <summary> | ||
693 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanRelatedBundle"/> | ||
694 | /// </summary> | ||
695 | [Serializable] | ||
696 | public class PlanRelatedBundleEventArgs : CancellableHResultEventArgs | ||
697 | { | ||
698 | /// <summary /> | ||
699 | public PlanRelatedBundleEventArgs(string bundleId, RequestState recommendedState, RequestState state, bool cancelRecommendation) | ||
700 | : base(cancelRecommendation) | ||
701 | { | ||
702 | this.BundleId = bundleId; | ||
703 | this.RecommendedState = recommendedState; | ||
704 | this.State = state; | ||
705 | } | ||
706 | |||
707 | /// <summary> | ||
708 | /// Gets the identity of the bundle to plan for. | ||
709 | /// </summary> | ||
710 | public string BundleId { get; private set; } | ||
711 | |||
712 | /// <summary> | ||
713 | /// Gets the recommended requested state for the bundle. | ||
714 | /// </summary> | ||
715 | public RequestState RecommendedState { get; private set; } | ||
716 | |||
717 | /// <summary> | ||
718 | /// Gets or sets the requested state for the bundle. | ||
719 | /// </summary> | ||
720 | public RequestState State { get; set; } | ||
721 | } | ||
722 | |||
723 | /// <summary> | ||
724 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanPackageBegin"/> | ||
725 | /// </summary> | ||
726 | [Serializable] | ||
727 | public class PlanPackageBeginEventArgs : CancellableHResultEventArgs | ||
728 | { | ||
729 | /// <summary /> | ||
730 | public PlanPackageBeginEventArgs(string packageId, PackageState currentState, bool cached, BOOTSTRAPPER_PACKAGE_CONDITION_RESULT installCondition, RequestState recommendedState, BOOTSTRAPPER_CACHE_TYPE recommendedCacheType, RequestState state, BOOTSTRAPPER_CACHE_TYPE cacheType, bool cancelRecommendation) | ||
731 | : base(cancelRecommendation) | ||
732 | { | ||
733 | this.PackageId = packageId; | ||
734 | this.CurrentState = currentState; | ||
735 | this.Cached = cached; | ||
736 | this.InstallCondition = installCondition; | ||
737 | this.RecommendedState = recommendedState; | ||
738 | this.RecommendedCacheType = recommendedCacheType; | ||
739 | this.State = state; | ||
740 | this.CacheType = cacheType; | ||
741 | } | ||
742 | |||
743 | /// <summary> | ||
744 | /// Gets the identity of the package to plan for. | ||
745 | /// </summary> | ||
746 | public string PackageId { get; private set; } | ||
747 | |||
748 | /// <summary> | ||
749 | /// Gets the current state of the package. | ||
750 | /// </summary> | ||
751 | public PackageState CurrentState { get; private set; } | ||
752 | |||
753 | /// <summary> | ||
754 | /// Gets whether any part of the package is cached. | ||
755 | /// </summary> | ||
756 | public bool Cached { get; private set; } | ||
757 | |||
758 | /// <summary> | ||
759 | /// Gets the evaluated result of the package's install condition. | ||
760 | /// </summary> | ||
761 | public BOOTSTRAPPER_PACKAGE_CONDITION_RESULT InstallCondition { get; private set; } | ||
762 | |||
763 | /// <summary> | ||
764 | /// Gets the recommended requested state for the package. | ||
765 | /// </summary> | ||
766 | public RequestState RecommendedState { get; private set; } | ||
767 | |||
768 | /// <summary> | ||
769 | /// The authored cache type of the package. | ||
770 | /// </summary> | ||
771 | public BOOTSTRAPPER_CACHE_TYPE RecommendedCacheType { get; private set; } | ||
772 | |||
773 | /// <summary> | ||
774 | /// Gets or sets the requested state for the package. | ||
775 | /// </summary> | ||
776 | public RequestState State { get; set; } | ||
777 | |||
778 | /// <summary> | ||
779 | /// Gets or sets the requested cache type for the package. | ||
780 | /// </summary> | ||
781 | public BOOTSTRAPPER_CACHE_TYPE CacheType { get; set; } | ||
782 | } | ||
783 | |||
784 | /// <summary> | ||
785 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanPatchTarget"/> | ||
786 | /// </summary> | ||
787 | [Serializable] | ||
788 | public class PlanPatchTargetEventArgs : CancellableHResultEventArgs | ||
789 | { | ||
790 | /// <summary> | ||
791 | /// | ||
792 | /// </summary> | ||
793 | /// <param name="packageId"></param> | ||
794 | /// <param name="productCode"></param> | ||
795 | /// <param name="recommendedState"></param> | ||
796 | /// <param name="state"></param> | ||
797 | /// <param name="cancelRecommendation"></param> | ||
798 | public PlanPatchTargetEventArgs(string packageId, string productCode, RequestState recommendedState, RequestState state, bool cancelRecommendation) | ||
799 | : base(cancelRecommendation) | ||
800 | { | ||
801 | this.PackageId = packageId; | ||
802 | this.ProductCode = productCode; | ||
803 | this.RecommendedState = recommendedState; | ||
804 | this.State = state; | ||
805 | } | ||
806 | |||
807 | /// <summary> | ||
808 | /// Gets the identity of the patch's package. | ||
809 | /// </summary> | ||
810 | public string PackageId { get; private set; } | ||
811 | |||
812 | /// <summary> | ||
813 | /// Gets the product code of the target. | ||
814 | /// </summary> | ||
815 | public string ProductCode { get; private set; } | ||
816 | |||
817 | /// <summary> | ||
818 | /// Gets the recommended state of the patch to use by planning for the target. | ||
819 | /// </summary> | ||
820 | public RequestState RecommendedState { get; private set; } | ||
821 | |||
822 | /// <summary> | ||
823 | /// Gets or sets the state of the patch to use by planning for the target. | ||
824 | /// </summary> | ||
825 | public RequestState State { get; set; } | ||
826 | } | ||
827 | |||
828 | /// <summary> | ||
829 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanMsiFeature"/> | ||
830 | /// </summary> | ||
831 | [Serializable] | ||
832 | public class PlanMsiFeatureEventArgs : CancellableHResultEventArgs | ||
833 | { | ||
834 | /// <summary /> | ||
835 | public PlanMsiFeatureEventArgs(string packageId, string featureId, FeatureState recommendedState, FeatureState state, bool cancelRecommendation) | ||
836 | : base(cancelRecommendation) | ||
837 | { | ||
838 | this.PackageId = packageId; | ||
839 | this.FeatureId = featureId; | ||
840 | this.RecommendedState = recommendedState; | ||
841 | this.State = state; | ||
842 | } | ||
843 | |||
844 | /// <summary> | ||
845 | /// Gets the identity of the feature's package to plan. | ||
846 | /// </summary> | ||
847 | public string PackageId { get; private set; } | ||
848 | |||
849 | /// <summary> | ||
850 | /// Gets the identity of the feature to plan. | ||
851 | /// </summary> | ||
852 | public string FeatureId { get; private set; } | ||
853 | |||
854 | /// <summary> | ||
855 | /// Gets the recommended feature state to use by planning. | ||
856 | /// </summary> | ||
857 | public FeatureState RecommendedState { get; private set; } | ||
858 | |||
859 | /// <summary> | ||
860 | /// Gets or sets the feature state to use by planning. | ||
861 | /// </summary> | ||
862 | public FeatureState State { get; set; } | ||
863 | } | ||
864 | |||
865 | /// <summary> | ||
866 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanMsiPackage"/> | ||
867 | /// </summary> | ||
868 | [Serializable] | ||
869 | public class PlanMsiPackageEventArgs : CancellableHResultEventArgs | ||
870 | { | ||
871 | /// <summary /> | ||
872 | public PlanMsiPackageEventArgs(string packageId, bool shouldExecute, ActionState action, bool cancelRecommendation, BURN_MSI_PROPERTY actionMsiProperty, INSTALLUILEVEL uiLevel, bool disableExternalUiHandler) | ||
873 | : base(cancelRecommendation) | ||
874 | { | ||
875 | this.PackageId = packageId; | ||
876 | this.ShouldExecute = shouldExecute; | ||
877 | this.Action = action; | ||
878 | this.ActionMsiProperty = actionMsiProperty; | ||
879 | this.UiLevel = uiLevel; | ||
880 | this.DisableExternalUiHandler = disableExternalUiHandler; | ||
881 | } | ||
882 | |||
883 | /// <summary> | ||
884 | /// Gets identity of the package planned for. | ||
885 | /// </summary> | ||
886 | public string PackageId { get; private set; } | ||
887 | |||
888 | /// <summary> | ||
889 | /// Gets whether the package is planned to execute or roll back. | ||
890 | /// </summary> | ||
891 | public bool ShouldExecute { get; private set; } | ||
892 | |||
893 | /// <summary> | ||
894 | /// Gets the action planned for the package. | ||
895 | /// </summary> | ||
896 | public ActionState Action { get; private set; } | ||
897 | |||
898 | /// <summary> | ||
899 | /// Gets or sets the requested MSI property to add. | ||
900 | /// </summary> | ||
901 | public BURN_MSI_PROPERTY ActionMsiProperty { get; set; } | ||
902 | |||
903 | /// <summary> | ||
904 | /// Gets or sets the requested internal UI level. | ||
905 | /// </summary> | ||
906 | public INSTALLUILEVEL UiLevel { get; set; } | ||
907 | |||
908 | /// <summary> | ||
909 | /// Gets or sets whether Burn is requested to set up an external UI handler. | ||
910 | /// </summary> | ||
911 | public bool DisableExternalUiHandler { get; set; } | ||
912 | } | ||
913 | |||
914 | /// <summary> | ||
915 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanPackageComplete"/> | ||
916 | /// </summary> | ||
917 | [Serializable] | ||
918 | public class PlanPackageCompleteEventArgs : StatusEventArgs | ||
919 | { | ||
920 | /// <summary> | ||
921 | /// | ||
922 | /// </summary> | ||
923 | /// <param name="packageId"></param> | ||
924 | /// <param name="hrStatus"></param> | ||
925 | /// <param name="requested"></param> | ||
926 | public PlanPackageCompleteEventArgs(string packageId, int hrStatus, RequestState requested) | ||
927 | : base(hrStatus) | ||
928 | { | ||
929 | this.PackageId = packageId; | ||
930 | this.Requested = requested; | ||
931 | } | ||
932 | |||
933 | /// <summary> | ||
934 | /// Gets the identity of the package planned for. | ||
935 | /// </summary> | ||
936 | public string PackageId { get; private set; } | ||
937 | |||
938 | /// <summary> | ||
939 | /// Gets the requested state for the package. | ||
940 | /// </summary> | ||
941 | public RequestState Requested { get; private set; } | ||
942 | } | ||
943 | |||
944 | /// <summary> | ||
945 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlannedPackage"/> | ||
946 | /// </summary> | ||
947 | [Serializable] | ||
948 | public class PlannedPackageEventArgs : HResultEventArgs | ||
949 | { | ||
950 | /// <summary /> | ||
951 | public PlannedPackageEventArgs(string packageId, ActionState execute, ActionState rollback, bool cache, bool uncache) | ||
952 | { | ||
953 | this.PackageId = packageId; | ||
954 | this.Execute = execute; | ||
955 | this.Rollback = rollback; | ||
956 | this.Cache = cache; | ||
957 | this.Uncache = uncache; | ||
958 | } | ||
959 | |||
960 | /// <summary> | ||
961 | /// Gets the identity of the package planned for. | ||
962 | /// </summary> | ||
963 | public string PackageId { get; private set; } | ||
964 | |||
965 | /// <summary> | ||
966 | /// Gets the planned execution action. | ||
967 | /// </summary> | ||
968 | public ActionState Execute { get; private set; } | ||
969 | |||
970 | /// <summary> | ||
971 | /// Gets the planned rollback action. | ||
972 | /// </summary> | ||
973 | public ActionState Rollback { get; private set; } | ||
974 | |||
975 | /// <summary> | ||
976 | /// Gets whether the package will be cached. | ||
977 | /// </summary> | ||
978 | public bool Cache { get; private set; } | ||
979 | |||
980 | /// <summary> | ||
981 | /// Gets whether the package will be removed from the package cache. | ||
982 | /// </summary> | ||
983 | public bool Uncache { get; private set; } | ||
984 | } | ||
985 | |||
986 | /// <summary> | ||
987 | /// Additional arguments used when the engine has completed planning the installation. | ||
988 | /// </summary> | ||
989 | [Serializable] | ||
990 | public class PlanCompleteEventArgs : StatusEventArgs | ||
991 | { | ||
992 | /// <summary> | ||
993 | /// Creates a new instance of the <see cref="PlanCompleteEventArgs"/> class. | ||
994 | /// </summary> | ||
995 | /// <param name="hrStatus">The return code of the operation.</param> | ||
996 | public PlanCompleteEventArgs(int hrStatus) | ||
997 | : base(hrStatus) | ||
998 | { | ||
999 | } | ||
1000 | } | ||
1001 | |||
1002 | /// <summary> | ||
1003 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanForwardCompatibleBundle"/> | ||
1004 | /// </summary> | ||
1005 | [Serializable] | ||
1006 | public class PlanForwardCompatibleBundleEventArgs : CancellableHResultEventArgs | ||
1007 | { | ||
1008 | /// <summary /> | ||
1009 | public PlanForwardCompatibleBundleEventArgs(string bundleId, RelationType relationType, string bundleTag, bool perMachine, string version, bool recommendedIgnoreBundle, bool cancelRecommendation, bool ignoreBundle) | ||
1010 | : base(cancelRecommendation) | ||
1011 | { | ||
1012 | this.BundleId = bundleId; | ||
1013 | this.RelationType = relationType; | ||
1014 | this.BundleTag = bundleTag; | ||
1015 | this.PerMachine = perMachine; | ||
1016 | this.Version = version; | ||
1017 | this.RecommendedIgnoreBundle = recommendedIgnoreBundle; | ||
1018 | this.IgnoreBundle = ignoreBundle; | ||
1019 | } | ||
1020 | |||
1021 | /// <summary> | ||
1022 | /// Gets the identity of the forward compatible bundle detected. | ||
1023 | /// </summary> | ||
1024 | public string BundleId { get; private set; } | ||
1025 | |||
1026 | /// <summary> | ||
1027 | /// Gets the relationship type of the forward compatible bundle. | ||
1028 | /// </summary> | ||
1029 | public RelationType RelationType { get; private set; } | ||
1030 | |||
1031 | /// <summary> | ||
1032 | /// Gets the tag of the forward compatible bundle. | ||
1033 | /// </summary> | ||
1034 | public string BundleTag { get; private set; } | ||
1035 | |||
1036 | /// <summary> | ||
1037 | /// Gets whether the forward compatible bundle is per machine. | ||
1038 | /// </summary> | ||
1039 | public bool PerMachine { get; private set; } | ||
1040 | |||
1041 | /// <summary> | ||
1042 | /// Gets the version of the forward compatible bundle. | ||
1043 | /// </summary> | ||
1044 | public string Version { get; private set; } | ||
1045 | |||
1046 | /// <summary> | ||
1047 | /// Gets the recommendation of whether the engine should use the forward compatible bundle. | ||
1048 | /// </summary> | ||
1049 | public bool RecommendedIgnoreBundle { get; set; } | ||
1050 | |||
1051 | /// <summary> | ||
1052 | /// Gets or sets whether the engine will use the forward compatible bundle. | ||
1053 | /// </summary> | ||
1054 | public bool IgnoreBundle { get; set; } | ||
1055 | } | ||
1056 | |||
1057 | /// <summary> | ||
1058 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.ApplyBegin"/> | ||
1059 | /// </summary> | ||
1060 | [Serializable] | ||
1061 | public class ApplyBeginEventArgs : CancellableHResultEventArgs | ||
1062 | { | ||
1063 | /// <summary /> | ||
1064 | public ApplyBeginEventArgs(int phaseCount, bool cancelRecommendation) | ||
1065 | : base(cancelRecommendation) | ||
1066 | { | ||
1067 | this.PhaseCount = phaseCount; | ||
1068 | } | ||
1069 | |||
1070 | /// <summary> | ||
1071 | /// Gets the number of phases that the engine will go through in apply. | ||
1072 | /// There are currently two possible phases: cache and execute. | ||
1073 | /// </summary> | ||
1074 | public int PhaseCount { get; private set; } | ||
1075 | } | ||
1076 | |||
1077 | /// <summary> | ||
1078 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.ElevateBegin"/> | ||
1079 | /// </summary> | ||
1080 | [Serializable] | ||
1081 | public class ElevateBeginEventArgs : CancellableHResultEventArgs | ||
1082 | { | ||
1083 | /// <summary /> | ||
1084 | public ElevateBeginEventArgs(bool cancelRecommendation) | ||
1085 | : base(cancelRecommendation) | ||
1086 | { | ||
1087 | } | ||
1088 | } | ||
1089 | |||
1090 | /// <summary> | ||
1091 | /// Additional arguments used when the engine has completed starting the elevated process. | ||
1092 | /// </summary> | ||
1093 | [Serializable] | ||
1094 | public class ElevateCompleteEventArgs : StatusEventArgs | ||
1095 | { | ||
1096 | /// <summary> | ||
1097 | /// Creates a new instance of the <see cref="ElevateCompleteEventArgs"/> class. | ||
1098 | /// </summary> | ||
1099 | /// <param name="hrStatus">The return code of the operation.</param> | ||
1100 | public ElevateCompleteEventArgs(int hrStatus) | ||
1101 | : base(hrStatus) | ||
1102 | { | ||
1103 | } | ||
1104 | } | ||
1105 | |||
1106 | /// <summary> | ||
1107 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.Progress"/> | ||
1108 | /// </summary> | ||
1109 | [Serializable] | ||
1110 | public class ProgressEventArgs : CancellableHResultEventArgs | ||
1111 | { | ||
1112 | /// <summary /> | ||
1113 | public ProgressEventArgs(int progressPercentage, int overallPercentage, bool cancelRecommendation) | ||
1114 | : base(cancelRecommendation) | ||
1115 | { | ||
1116 | this.ProgressPercentage = progressPercentage; | ||
1117 | this.OverallPercentage = overallPercentage; | ||
1118 | } | ||
1119 | |||
1120 | /// <summary> | ||
1121 | /// Gets the percentage from 0 to 100 completed for a package. | ||
1122 | /// </summary> | ||
1123 | public int ProgressPercentage { get; private set; } | ||
1124 | |||
1125 | /// <summary> | ||
1126 | /// Gets the percentage from 0 to 100 completed for the bundle. | ||
1127 | /// </summary> | ||
1128 | public int OverallPercentage { get; private set; } | ||
1129 | } | ||
1130 | |||
1131 | /// <summary> | ||
1132 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.Error"/> | ||
1133 | /// </summary> | ||
1134 | [Serializable] | ||
1135 | public class ErrorEventArgs : ResultEventArgs | ||
1136 | { | ||
1137 | /// <summary /> | ||
1138 | public ErrorEventArgs(ErrorType errorType, string packageId, int errorCode, string errorMessage, int dwUIHint, string[] data, Result recommendation, Result result) | ||
1139 | : base(recommendation, result) | ||
1140 | { | ||
1141 | this.ErrorType = errorType; | ||
1142 | this.PackageId = packageId; | ||
1143 | this.ErrorCode = errorCode; | ||
1144 | this.ErrorMessage = errorMessage; | ||
1145 | this.UIHint = dwUIHint; | ||
1146 | this.Data = new ReadOnlyCollection<string>(data ?? new string[] { }); | ||
1147 | } | ||
1148 | |||
1149 | /// <summary> | ||
1150 | /// Gets the type of error that occurred. | ||
1151 | /// </summary> | ||
1152 | public ErrorType ErrorType { get; private set; } | ||
1153 | |||
1154 | /// <summary> | ||
1155 | /// Gets the identity of the package that yielded the error. | ||
1156 | /// </summary> | ||
1157 | public string PackageId { get; private set; } | ||
1158 | |||
1159 | /// <summary> | ||
1160 | /// Gets the error code. | ||
1161 | /// </summary> | ||
1162 | public int ErrorCode { get; private set; } | ||
1163 | |||
1164 | /// <summary> | ||
1165 | /// Gets the error message. | ||
1166 | /// </summary> | ||
1167 | public string ErrorMessage { get; private set; } | ||
1168 | |||
1169 | /// <summary> | ||
1170 | /// Gets the recommended display flags for an error dialog. | ||
1171 | /// </summary> | ||
1172 | public int UIHint { get; private set; } | ||
1173 | |||
1174 | /// <summary> | ||
1175 | /// Gets the extended data for the error. | ||
1176 | /// </summary> | ||
1177 | public IList<string> Data { get; private set; } | ||
1178 | } | ||
1179 | |||
1180 | /// <summary> | ||
1181 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.RegisterBegin"/> | ||
1182 | /// </summary> | ||
1183 | [Serializable] | ||
1184 | public class RegisterBeginEventArgs : CancellableHResultEventArgs | ||
1185 | { | ||
1186 | /// <summary /> | ||
1187 | public RegisterBeginEventArgs(bool cancelRecommendation) | ||
1188 | : base(cancelRecommendation) | ||
1189 | { | ||
1190 | } | ||
1191 | } | ||
1192 | |||
1193 | /// <summary> | ||
1194 | /// Additional arguments used when the engine has completed registering the location and visilibity of the bundle. | ||
1195 | /// </summary> | ||
1196 | [Serializable] | ||
1197 | public class RegisterCompleteEventArgs : StatusEventArgs | ||
1198 | { | ||
1199 | /// <summary> | ||
1200 | /// Creates a new instance of the <see cref="RegisterCompleteEventArgs"/> class. | ||
1201 | /// </summary> | ||
1202 | /// <param name="hrStatus">The return code of the operation.</param> | ||
1203 | public RegisterCompleteEventArgs(int hrStatus) | ||
1204 | : base(hrStatus) | ||
1205 | { | ||
1206 | } | ||
1207 | } | ||
1208 | |||
1209 | /// <summary> | ||
1210 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.UnregisterBegin"/> | ||
1211 | /// </summary> | ||
1212 | [Serializable] | ||
1213 | public class UnregisterBeginEventArgs : HResultEventArgs | ||
1214 | { | ||
1215 | /// <summary> | ||
1216 | /// | ||
1217 | /// </summary> | ||
1218 | /// <param name="keepRegistration"></param> | ||
1219 | /// <param name="forceKeepRegistration"></param> | ||
1220 | public UnregisterBeginEventArgs(bool keepRegistration, bool forceKeepRegistration) | ||
1221 | { | ||
1222 | this.KeepRegistration = keepRegistration; | ||
1223 | this.ForceKeepRegistration = forceKeepRegistration; | ||
1224 | } | ||
1225 | |||
1226 | /// <summary> | ||
1227 | /// Indicates whether the engine will uninstall the bundle. | ||
1228 | /// </summary> | ||
1229 | public bool ForceKeepRegistration { get; set; } | ||
1230 | |||
1231 | /// <summary> | ||
1232 | /// If <see cref="KeepRegistration"/> is FALSE, then this can be set to TRUE to make the engine keep the bundle installed. | ||
1233 | /// </summary> | ||
1234 | public bool KeepRegistration { get; private set; } | ||
1235 | } | ||
1236 | |||
1237 | /// <summary> | ||
1238 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.UnregisterComplete"/> | ||
1239 | /// </summary> | ||
1240 | [Serializable] | ||
1241 | public class UnregisterCompleteEventArgs : StatusEventArgs | ||
1242 | { | ||
1243 | /// <summary> | ||
1244 | /// | ||
1245 | /// </summary> | ||
1246 | /// <param name="hrStatus"></param> | ||
1247 | public UnregisterCompleteEventArgs(int hrStatus) | ||
1248 | : base(hrStatus) | ||
1249 | { | ||
1250 | } | ||
1251 | } | ||
1252 | |||
1253 | /// <summary> | ||
1254 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.CacheBegin"/> | ||
1255 | /// </summary> | ||
1256 | [Serializable] | ||
1257 | public class CacheBeginEventArgs : CancellableHResultEventArgs | ||
1258 | { | ||
1259 | /// <summary /> | ||
1260 | public CacheBeginEventArgs(bool cancelRecommendation) | ||
1261 | : base(cancelRecommendation) | ||
1262 | { | ||
1263 | } | ||
1264 | } | ||
1265 | |||
1266 | /// <summary> | ||
1267 | /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheAcquireBegin"/>. | ||
1268 | /// </summary> | ||
1269 | [Serializable] | ||
1270 | public class CacheAcquireBeginEventArgs : CancellableActionEventArgs<CacheOperation> | ||
1271 | { | ||
1272 | /// <summary /> | ||
1273 | public CacheAcquireBeginEventArgs(string packageOrContainerId, string payloadId, string source, string downloadUrl, string payloadContainerId, CacheOperation recommendation, CacheOperation action, bool cancelRecommendation) | ||
1274 | : base(cancelRecommendation, recommendation, action) | ||
1275 | { | ||
1276 | this.PackageOrContainerId = packageOrContainerId; | ||
1277 | this.PayloadId = payloadId; | ||
1278 | this.Source = source; | ||
1279 | this.DownloadUrl = downloadUrl; | ||
1280 | this.PayloadContainerId = payloadContainerId; | ||
1281 | } | ||
1282 | |||
1283 | /// <summary> | ||
1284 | /// Gets the identifier of the container or package. | ||
1285 | /// </summary> | ||
1286 | public string PackageOrContainerId { get; private set; } | ||
1287 | |||
1288 | /// <summary> | ||
1289 | /// Gets the identifier of the payload (if acquiring a payload). | ||
1290 | /// </summary> | ||
1291 | public string PayloadId { get; private set; } | ||
1292 | |||
1293 | /// <summary> | ||
1294 | /// Gets the source of the container or payload. | ||
1295 | /// </summary> | ||
1296 | public string Source { get; private set; } | ||
1297 | |||
1298 | /// <summary> | ||
1299 | /// Gets the optional URL to download container or payload. | ||
1300 | /// </summary> | ||
1301 | public string DownloadUrl { get; private set; } | ||
1302 | |||
1303 | /// <summary> | ||
1304 | /// Gets the optional identity of the container that contains the payload being acquired. | ||
1305 | /// </summary> | ||
1306 | public string PayloadContainerId { get; private set; } | ||
1307 | } | ||
1308 | |||
1309 | /// <summary> | ||
1310 | /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheAcquireProgress"/>. | ||
1311 | /// </summary> | ||
1312 | [Serializable] | ||
1313 | public class CacheAcquireProgressEventArgs : CacheProgressBaseEventArgs | ||
1314 | { | ||
1315 | /// <summary /> | ||
1316 | public CacheAcquireProgressEventArgs(string packageOrContainerId, string payloadId, long progress, long total, int overallPercentage, bool cancelRecommendation) | ||
1317 | : base(packageOrContainerId, payloadId, progress, total, overallPercentage, cancelRecommendation) | ||
1318 | { | ||
1319 | } | ||
1320 | } | ||
1321 | |||
1322 | /// <summary> | ||
1323 | /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheAcquireComplete"/>. | ||
1324 | /// </summary> | ||
1325 | [Serializable] | ||
1326 | public class CacheAcquireCompleteEventArgs : ActionEventArgs<BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION> | ||
1327 | { | ||
1328 | /// <summary /> | ||
1329 | public CacheAcquireCompleteEventArgs(string packageOrContainerId, string payloadId, int hrStatus, BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION recommendation, BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION action) | ||
1330 | : base(hrStatus, recommendation, action) | ||
1331 | { | ||
1332 | this.PackageOrContainerId = packageOrContainerId; | ||
1333 | this.PayloadId = payloadId; | ||
1334 | } | ||
1335 | |||
1336 | /// <summary> | ||
1337 | /// Gets the identifier of the container or package. | ||
1338 | /// </summary> | ||
1339 | public string PackageOrContainerId { get; private set; } | ||
1340 | |||
1341 | /// <summary> | ||
1342 | /// Gets the identifier of the payload (if acquiring a payload). | ||
1343 | /// </summary> | ||
1344 | public string PayloadId { get; private set; } | ||
1345 | } | ||
1346 | |||
1347 | /// <summary> | ||
1348 | /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheVerifyBegin"/>. | ||
1349 | /// </summary> | ||
1350 | [Serializable] | ||
1351 | public class CacheVerifyBeginEventArgs : CancellableHResultEventArgs | ||
1352 | { | ||
1353 | /// <summary /> | ||
1354 | public CacheVerifyBeginEventArgs(string packageOrContainerId, string payloadId, bool cancelRecommendation) | ||
1355 | : base(cancelRecommendation) | ||
1356 | { | ||
1357 | this.PackageOrContainerId = packageOrContainerId; | ||
1358 | this.PayloadId = payloadId; | ||
1359 | } | ||
1360 | |||
1361 | /// <summary> | ||
1362 | /// Gets the identifier of the container or package. | ||
1363 | /// </summary> | ||
1364 | public string PackageOrContainerId { get; private set; } | ||
1365 | |||
1366 | /// <summary> | ||
1367 | /// Gets the identifier of the payload. | ||
1368 | /// </summary> | ||
1369 | public string PayloadId { get; private set; } | ||
1370 | } | ||
1371 | |||
1372 | /// <summary> | ||
1373 | /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheVerifyProgress"/>. | ||
1374 | /// </summary> | ||
1375 | [Serializable] | ||
1376 | public class CacheVerifyProgressEventArgs : CacheProgressBaseEventArgs | ||
1377 | { | ||
1378 | /// <summary /> | ||
1379 | public CacheVerifyProgressEventArgs(string packageOrContainerId, string payloadId, long progress, long total, int overallPercentage, CacheVerifyStep verifyStep, bool cancelRecommendation) | ||
1380 | : base(packageOrContainerId, payloadId, progress, total, overallPercentage, cancelRecommendation) | ||
1381 | { | ||
1382 | this.Step = verifyStep; | ||
1383 | } | ||
1384 | |||
1385 | /// <summary> | ||
1386 | /// Gets the current verification step. | ||
1387 | /// </summary> | ||
1388 | public CacheVerifyStep Step { get; private set; } | ||
1389 | } | ||
1390 | |||
1391 | /// <summary> | ||
1392 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.CacheVerifyComplete"/> | ||
1393 | /// </summary> | ||
1394 | [Serializable] | ||
1395 | public class CacheVerifyCompleteEventArgs : ActionEventArgs<BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION> | ||
1396 | { | ||
1397 | /// <summary /> | ||
1398 | public CacheVerifyCompleteEventArgs(string packageOrContainerId, string payloadId, int hrStatus, BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION recommendation, BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION action) | ||
1399 | : base(hrStatus, recommendation, action) | ||
1400 | { | ||
1401 | this.PackageOrContainerId = packageOrContainerId; | ||
1402 | this.PayloadId = payloadId; | ||
1403 | } | ||
1404 | |||
1405 | /// <summary> | ||
1406 | /// Gets the identifier of the container or package. | ||
1407 | /// </summary> | ||
1408 | public string PackageOrContainerId { get; private set; } | ||
1409 | |||
1410 | /// <summary> | ||
1411 | /// Gets the identifier of the payload. | ||
1412 | /// </summary> | ||
1413 | public string PayloadId { get; private set; } | ||
1414 | } | ||
1415 | |||
1416 | /// <summary> | ||
1417 | /// Additional arguments used after the engine has cached the installation sources. | ||
1418 | /// </summary> | ||
1419 | [Serializable] | ||
1420 | public class CacheCompleteEventArgs : StatusEventArgs | ||
1421 | { | ||
1422 | /// <summary> | ||
1423 | /// Creates a new instance of the <see cref="CacheCompleteEventArgs"/> class. | ||
1424 | /// </summary> | ||
1425 | /// <param name="hrStatus">The return code of the operation.</param> | ||
1426 | public CacheCompleteEventArgs(int hrStatus) | ||
1427 | : base(hrStatus) | ||
1428 | { | ||
1429 | } | ||
1430 | } | ||
1431 | |||
1432 | /// <summary> | ||
1433 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.ExecuteBegin"/> | ||
1434 | /// </summary> | ||
1435 | [Serializable] | ||
1436 | public class ExecuteBeginEventArgs : CancellableHResultEventArgs | ||
1437 | { | ||
1438 | /// <summary /> | ||
1439 | public ExecuteBeginEventArgs(int packageCount, bool cancelRecommendation) | ||
1440 | : base(cancelRecommendation) | ||
1441 | { | ||
1442 | this.PackageCount = packageCount; | ||
1443 | } | ||
1444 | |||
1445 | /// <summary> | ||
1446 | /// Gets the number of packages to act on. | ||
1447 | /// </summary> | ||
1448 | public int PackageCount { get; private set; } | ||
1449 | } | ||
1450 | |||
1451 | /// <summary> | ||
1452 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.ExecutePackageBegin"/> | ||
1453 | /// </summary> | ||
1454 | [Serializable] | ||
1455 | public class ExecutePackageBeginEventArgs : CancellableHResultEventArgs | ||
1456 | { | ||
1457 | /// <summary /> | ||
1458 | public ExecutePackageBeginEventArgs(string packageId, bool shouldExecute, ActionState action, INSTALLUILEVEL uiLevel, bool disableExternalUiHandler, bool cancelRecommendation) | ||
1459 | : base(cancelRecommendation) | ||
1460 | { | ||
1461 | this.PackageId = packageId; | ||
1462 | this.ShouldExecute = shouldExecute; | ||
1463 | this.Action = action; | ||
1464 | this.UiLevel = uiLevel; | ||
1465 | this.DisableExternalUiHandler = disableExternalUiHandler; | ||
1466 | } | ||
1467 | |||
1468 | /// <summary> | ||
1469 | /// Gets the identity of the package to act on. | ||
1470 | /// </summary> | ||
1471 | public string PackageId { get; private set; } | ||
1472 | |||
1473 | /// <summary> | ||
1474 | /// Gets whether the package is being executed or rolled back. | ||
1475 | /// </summary> | ||
1476 | public bool ShouldExecute { get; private set; } | ||
1477 | |||
1478 | /// <summary> | ||
1479 | /// Gets the action about to be executed. | ||
1480 | /// </summary> | ||
1481 | public ActionState Action { get; private set; } | ||
1482 | |||
1483 | /// <summary> | ||
1484 | /// Gets the internal UI level (if this is an MSI or MSP package). | ||
1485 | /// </summary> | ||
1486 | public INSTALLUILEVEL UiLevel { get; private set; } | ||
1487 | |||
1488 | /// <summary> | ||
1489 | /// Gets whether Burn will set up an external UI handler (if this is an MSI or MSP package). | ||
1490 | /// </summary> | ||
1491 | public bool DisableExternalUiHandler { get; private set; } | ||
1492 | } | ||
1493 | |||
1494 | /// <summary> | ||
1495 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.ExecutePatchTarget"/> | ||
1496 | /// </summary> | ||
1497 | [Serializable] | ||
1498 | public class ExecutePatchTargetEventArgs : CancellableHResultEventArgs | ||
1499 | { | ||
1500 | /// <summary /> | ||
1501 | public ExecutePatchTargetEventArgs(string packageId, string targetProductCode, bool cancelRecommendation) | ||
1502 | : base(cancelRecommendation) | ||
1503 | { | ||
1504 | this.PackageId = packageId; | ||
1505 | this.TargetProductCode = targetProductCode; | ||
1506 | } | ||
1507 | |||
1508 | /// <summary> | ||
1509 | /// Gets the identity of the package to act on. | ||
1510 | /// </summary> | ||
1511 | public string PackageId { get; private set; } | ||
1512 | |||
1513 | /// <summary> | ||
1514 | /// Gets the product code being targeted. | ||
1515 | /// </summary> | ||
1516 | public string TargetProductCode { get; private set; } | ||
1517 | } | ||
1518 | |||
1519 | /// <summary> | ||
1520 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.ExecuteMsiMessage"/> | ||
1521 | /// </summary> | ||
1522 | [Serializable] | ||
1523 | public class ExecuteMsiMessageEventArgs : ResultEventArgs | ||
1524 | { | ||
1525 | /// <summary /> | ||
1526 | public ExecuteMsiMessageEventArgs(string packageId, InstallMessage messageType, int dwUIHint, string message, string[] data, Result recommendation, Result result) | ||
1527 | : base(recommendation, result) | ||
1528 | { | ||
1529 | this.PackageId = packageId; | ||
1530 | this.MessageType = messageType; | ||
1531 | this.UIHint = dwUIHint; | ||
1532 | this.Message = message; | ||
1533 | this.Data = new ReadOnlyCollection<string>(data ?? new string[] { }); | ||
1534 | } | ||
1535 | |||
1536 | /// <summary> | ||
1537 | /// Gets the identity of the package that yielded this message. | ||
1538 | /// </summary> | ||
1539 | public string PackageId { get; private set; } | ||
1540 | |||
1541 | /// <summary> | ||
1542 | /// Gets the type of this message. | ||
1543 | /// </summary> | ||
1544 | public InstallMessage MessageType { get; private set; } | ||
1545 | |||
1546 | /// <summary> | ||
1547 | /// Gets the recommended display flags for this message. | ||
1548 | /// </summary> | ||
1549 | public int UIHint { get; private set; } | ||
1550 | |||
1551 | /// <summary> | ||
1552 | /// Gets the message. | ||
1553 | /// </summary> | ||
1554 | public string Message { get; private set; } | ||
1555 | |||
1556 | /// <summary> | ||
1557 | /// Gets the extended data for the message. | ||
1558 | /// </summary> | ||
1559 | public IList<string> Data { get; private set; } | ||
1560 | } | ||
1561 | |||
1562 | /// <summary> | ||
1563 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.ExecuteFilesInUse"/> | ||
1564 | /// </summary> | ||
1565 | [Serializable] | ||
1566 | public class ExecuteFilesInUseEventArgs : ResultEventArgs | ||
1567 | { | ||
1568 | /// <summary /> | ||
1569 | public ExecuteFilesInUseEventArgs(string packageId, string[] files, Result recommendation, Result result) | ||
1570 | : base(recommendation, result) | ||
1571 | { | ||
1572 | this.PackageId = packageId; | ||
1573 | this.Files = new ReadOnlyCollection<string>(files ?? new string[] { }); | ||
1574 | } | ||
1575 | |||
1576 | /// <summary> | ||
1577 | /// Gets the identity of the package that yielded the files in use message. | ||
1578 | /// </summary> | ||
1579 | public string PackageId { get; private set; } | ||
1580 | |||
1581 | /// <summary> | ||
1582 | /// Gets the list of files in use. | ||
1583 | /// </summary> | ||
1584 | public IList<string> Files { get; private set; } | ||
1585 | } | ||
1586 | |||
1587 | /// <summary> | ||
1588 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.ExecutePackageComplete"/> | ||
1589 | /// Additional arguments used when the engine has completed installing a specific package. | ||
1590 | /// </summary> | ||
1591 | [Serializable] | ||
1592 | public class ExecutePackageCompleteEventArgs : ActionEventArgs<BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION> | ||
1593 | { | ||
1594 | /// <summary /> | ||
1595 | public ExecutePackageCompleteEventArgs(string packageId, int hrStatus, ApplyRestart restart, BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION recommendation, BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION action) | ||
1596 | : base(hrStatus, recommendation, action) | ||
1597 | { | ||
1598 | this.PackageId = packageId; | ||
1599 | this.Restart = restart; | ||
1600 | } | ||
1601 | |||
1602 | /// <summary> | ||
1603 | /// Gets the identity of the package that was acted on. | ||
1604 | /// </summary> | ||
1605 | public string PackageId { get; private set; } | ||
1606 | |||
1607 | /// <summary> | ||
1608 | /// Gets the package restart state after being applied. | ||
1609 | /// </summary> | ||
1610 | public ApplyRestart Restart { get; private set; } | ||
1611 | } | ||
1612 | |||
1613 | /// <summary> | ||
1614 | /// Additional arguments used when the engine has completed installing packages. | ||
1615 | /// </summary> | ||
1616 | [Serializable] | ||
1617 | public class ExecuteCompleteEventArgs : StatusEventArgs | ||
1618 | { | ||
1619 | /// <summary> | ||
1620 | /// Creates a new instance of the <see cref="ExecuteCompleteEventArgs"/> class. | ||
1621 | /// </summary> | ||
1622 | /// <param name="hrStatus">The return code of the operation.</param> | ||
1623 | public ExecuteCompleteEventArgs(int hrStatus) | ||
1624 | : base(hrStatus) | ||
1625 | { | ||
1626 | } | ||
1627 | } | ||
1628 | |||
1629 | /// <summary> | ||
1630 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.ApplyComplete"/> | ||
1631 | /// </summary> | ||
1632 | [Serializable] | ||
1633 | public class ApplyCompleteEventArgs : ActionEventArgs<BOOTSTRAPPER_APPLYCOMPLETE_ACTION> | ||
1634 | { | ||
1635 | /// <summary /> | ||
1636 | public ApplyCompleteEventArgs(int hrStatus, ApplyRestart restart, BOOTSTRAPPER_APPLYCOMPLETE_ACTION recommendation, BOOTSTRAPPER_APPLYCOMPLETE_ACTION action) | ||
1637 | : base(hrStatus, recommendation, action) | ||
1638 | { | ||
1639 | this.Restart = restart; | ||
1640 | } | ||
1641 | |||
1642 | /// <summary> | ||
1643 | /// Gets the apply restart state when complete. | ||
1644 | /// </summary> | ||
1645 | public ApplyRestart Restart { get; private set; } | ||
1646 | } | ||
1647 | |||
1648 | /// <summary> | ||
1649 | /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheAcquireResolving"/>. | ||
1650 | /// </summary> | ||
1651 | [Serializable] | ||
1652 | public class CacheAcquireResolvingEventArgs : CancellableActionEventArgs<CacheResolveOperation> | ||
1653 | { | ||
1654 | /// <summary /> | ||
1655 | public CacheAcquireResolvingEventArgs(string packageOrContainerId, string payloadId, string[] searchPaths, bool foundLocal, int recommendedSearchPath, string downloadUrl, string payloadContainerId, CacheResolveOperation recommendation, int chosenSearchPath, CacheResolveOperation action, bool cancel) | ||
1656 | : base(cancel, recommendation, action) | ||
1657 | { | ||
1658 | this.PackageOrContainerId = packageOrContainerId; | ||
1659 | this.PayloadId = payloadId; | ||
1660 | this.SearchPaths = searchPaths; | ||
1661 | this.FoundLocal = foundLocal; | ||
1662 | this.RecommendedSearchPath = recommendedSearchPath; | ||
1663 | this.DownloadUrl = downloadUrl; | ||
1664 | this.PayloadContainerId = payloadContainerId; | ||
1665 | this.ChosenSearchPath = chosenSearchPath; | ||
1666 | } | ||
1667 | |||
1668 | /// <summary> | ||
1669 | /// Gets the identity of the package or container that is being acquired. | ||
1670 | /// </summary> | ||
1671 | public string PackageOrContainerId { get; private set; } | ||
1672 | |||
1673 | /// <summary> | ||
1674 | /// Gets the identity of the payload that is being acquired. | ||
1675 | /// </summary> | ||
1676 | public string PayloadId { get; private set; } | ||
1677 | |||
1678 | /// <summary> | ||
1679 | /// Gets the search paths used for source resolution. | ||
1680 | /// </summary> | ||
1681 | public string[] SearchPaths { get; private set; } | ||
1682 | |||
1683 | /// <summary> | ||
1684 | /// Gets whether <see cref="RecommendedSearchPath"/> indicates that a file was found at that search path. | ||
1685 | /// </summary> | ||
1686 | public bool FoundLocal { get; private set; } | ||
1687 | |||
1688 | /// <summary> | ||
1689 | /// When <see cref="FoundLocal"/> is true, the index to <see cref="SearchPaths"/> for the recommended local file. | ||
1690 | /// </summary> | ||
1691 | public int RecommendedSearchPath { get; private set; } | ||
1692 | |||
1693 | /// <summary> | ||
1694 | /// Gets the optional URL to download container or payload. | ||
1695 | /// </summary> | ||
1696 | public string DownloadUrl { get; private set; } | ||
1697 | |||
1698 | /// <summary> | ||
1699 | /// Gets the optional identity of the container that contains the payload being acquired. | ||
1700 | /// </summary> | ||
1701 | public string PayloadContainerId { get; private set; } | ||
1702 | |||
1703 | /// <summary> | ||
1704 | /// Gets or sets the index to <see cref="SearchPaths"/> to use when <see cref="CancellableActionEventArgs{T}.Action"/> is set to <see cref="CacheOperation.Copy"/>. | ||
1705 | /// </summary> | ||
1706 | public int ChosenSearchPath { get; set; } | ||
1707 | } | ||
1708 | |||
1709 | /// <summary> | ||
1710 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.CachePackageBegin"/> | ||
1711 | /// </summary> | ||
1712 | [Serializable] | ||
1713 | public class CachePackageBeginEventArgs : CancellableHResultEventArgs | ||
1714 | { | ||
1715 | /// <summary /> | ||
1716 | public CachePackageBeginEventArgs(string packageId, int cachePayloads, long packageCacheSize, bool cancelRecommendation) | ||
1717 | : base(cancelRecommendation) | ||
1718 | { | ||
1719 | this.PackageId = packageId; | ||
1720 | this.CachePayloads = cachePayloads; | ||
1721 | this.PackageCacheSize = packageCacheSize; | ||
1722 | } | ||
1723 | |||
1724 | /// <summary> | ||
1725 | /// Gets the identity of the package that is being cached. | ||
1726 | /// </summary> | ||
1727 | public string PackageId { get; private set; } | ||
1728 | |||
1729 | /// <summary> | ||
1730 | /// Gets number of payloads to be cached. | ||
1731 | /// </summary> | ||
1732 | public long CachePayloads { get; private set; } | ||
1733 | |||
1734 | /// <summary> | ||
1735 | /// Gets the size on disk required by the specific package. | ||
1736 | /// </summary> | ||
1737 | public long PackageCacheSize { get; private set; } | ||
1738 | } | ||
1739 | |||
1740 | /// <summary> | ||
1741 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.CachePackageComplete"/> | ||
1742 | /// </summary> | ||
1743 | [Serializable] | ||
1744 | public class CachePackageCompleteEventArgs : ActionEventArgs<BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION> | ||
1745 | { | ||
1746 | /// <summary /> | ||
1747 | public CachePackageCompleteEventArgs(string packageId, int hrStatus, BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION recommendation, BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION action) | ||
1748 | : base(hrStatus, recommendation, action) | ||
1749 | { | ||
1750 | this.PackageId = packageId; | ||
1751 | } | ||
1752 | |||
1753 | /// <summary> | ||
1754 | /// Gets the identity of the package that was cached. | ||
1755 | /// </summary> | ||
1756 | public string PackageId { get; private set; } | ||
1757 | } | ||
1758 | |||
1759 | /// <summary> | ||
1760 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.ExecuteProgress"/> | ||
1761 | /// </summary> | ||
1762 | [Serializable] | ||
1763 | public class ExecuteProgressEventArgs : CancellableHResultEventArgs | ||
1764 | { | ||
1765 | /// <summary /> | ||
1766 | public ExecuteProgressEventArgs(string packageId, int progressPercentage, int overallPercentage, bool cancelRecommendation) | ||
1767 | : base(cancelRecommendation) | ||
1768 | { | ||
1769 | this.PackageId = packageId; | ||
1770 | this.ProgressPercentage = progressPercentage; | ||
1771 | this.OverallPercentage = overallPercentage; | ||
1772 | } | ||
1773 | |||
1774 | /// <summary> | ||
1775 | /// Gets the identity of the package that was executed. | ||
1776 | /// </summary> | ||
1777 | public string PackageId { get; private set; } | ||
1778 | |||
1779 | /// <summary> | ||
1780 | /// Gets the percentage from 0 to 100 of the execution progress for a single payload. | ||
1781 | /// </summary> | ||
1782 | public int ProgressPercentage { get; private set; } | ||
1783 | |||
1784 | /// <summary> | ||
1785 | /// Gets the percentage from 0 to 100 of the execution progress for all payloads. | ||
1786 | /// </summary> | ||
1787 | public int OverallPercentage { get; private set; } | ||
1788 | } | ||
1789 | |||
1790 | /// <summary> | ||
1791 | /// Additional arguments passed by the engine before it tries to launch the preapproved executable. | ||
1792 | /// </summary> | ||
1793 | [Serializable] | ||
1794 | public class LaunchApprovedExeBeginEventArgs : CancellableHResultEventArgs | ||
1795 | { | ||
1796 | /// <summary> | ||
1797 | /// | ||
1798 | /// </summary> | ||
1799 | /// <param name="cancelRecommendation"></param> | ||
1800 | public LaunchApprovedExeBeginEventArgs(bool cancelRecommendation) | ||
1801 | : base(cancelRecommendation) | ||
1802 | { | ||
1803 | } | ||
1804 | } | ||
1805 | |||
1806 | /// <summary> | ||
1807 | /// Additional arguments passed by the engine after it finished trying to launch the preapproved executable. | ||
1808 | /// </summary> | ||
1809 | [Serializable] | ||
1810 | public class LaunchApprovedExeCompleteEventArgs : StatusEventArgs | ||
1811 | { | ||
1812 | private int processId; | ||
1813 | |||
1814 | /// <summary> | ||
1815 | /// | ||
1816 | /// </summary> | ||
1817 | /// <param name="hrStatus"></param> | ||
1818 | /// <param name="processId"></param> | ||
1819 | public LaunchApprovedExeCompleteEventArgs(int hrStatus, int processId) | ||
1820 | : base(hrStatus) | ||
1821 | { | ||
1822 | this.processId = processId; | ||
1823 | } | ||
1824 | |||
1825 | /// <summary> | ||
1826 | /// Gets the ProcessId of the process that was launched. | ||
1827 | /// This is only valid if the status reports success. | ||
1828 | /// </summary> | ||
1829 | public int ProcessId | ||
1830 | { | ||
1831 | get { return this.processId; } | ||
1832 | } | ||
1833 | } | ||
1834 | |||
1835 | /// <summary> | ||
1836 | /// Additional arguments passed by the engine before beginning an MSI transaction. | ||
1837 | /// </summary> | ||
1838 | [Serializable] | ||
1839 | public class BeginMsiTransactionBeginEventArgs : CancellableHResultEventArgs | ||
1840 | { | ||
1841 | private string transactionId; | ||
1842 | |||
1843 | /// <summary> | ||
1844 | /// | ||
1845 | /// </summary> | ||
1846 | /// <param name="transactionId"></param> | ||
1847 | /// <param name="cancelRecommendation"></param> | ||
1848 | public BeginMsiTransactionBeginEventArgs(string transactionId, bool cancelRecommendation) | ||
1849 | : base(cancelRecommendation) | ||
1850 | { | ||
1851 | this.transactionId = transactionId; | ||
1852 | } | ||
1853 | |||
1854 | /// <summary> | ||
1855 | /// Gets the MSI transaction Id. | ||
1856 | /// </summary> | ||
1857 | public string TransactionId | ||
1858 | { | ||
1859 | get { return this.transactionId; } | ||
1860 | } | ||
1861 | } | ||
1862 | |||
1863 | /// <summary> | ||
1864 | /// Additional arguments passed by the engine after beginning an MSI transaction. | ||
1865 | /// </summary> | ||
1866 | [Serializable] | ||
1867 | public class BeginMsiTransactionCompleteEventArgs : StatusEventArgs | ||
1868 | { | ||
1869 | private string transactionId; | ||
1870 | |||
1871 | /// <summary> | ||
1872 | /// | ||
1873 | /// </summary> | ||
1874 | /// <param name="transactionId"></param> | ||
1875 | /// <param name="hrStatus"></param> | ||
1876 | public BeginMsiTransactionCompleteEventArgs(string transactionId, int hrStatus) | ||
1877 | : base(hrStatus) | ||
1878 | { | ||
1879 | this.transactionId = transactionId; | ||
1880 | } | ||
1881 | |||
1882 | /// <summary> | ||
1883 | /// Gets the MSI transaction Id. | ||
1884 | /// </summary> | ||
1885 | public string TransactionId | ||
1886 | { | ||
1887 | get { return this.transactionId; } | ||
1888 | } | ||
1889 | } | ||
1890 | |||
1891 | /// <summary> | ||
1892 | /// Additional arguments passed by the engine before committing an MSI transaction. | ||
1893 | /// </summary> | ||
1894 | [Serializable] | ||
1895 | public class CommitMsiTransactionBeginEventArgs : CancellableHResultEventArgs | ||
1896 | { | ||
1897 | private string transactionId; | ||
1898 | |||
1899 | /// <summary> | ||
1900 | /// | ||
1901 | /// </summary> | ||
1902 | /// <param name="transactionId"></param> | ||
1903 | /// <param name="cancelRecommendation"></param> | ||
1904 | public CommitMsiTransactionBeginEventArgs(string transactionId, bool cancelRecommendation) | ||
1905 | : base(cancelRecommendation) | ||
1906 | { | ||
1907 | this.transactionId = transactionId; | ||
1908 | } | ||
1909 | |||
1910 | /// <summary> | ||
1911 | /// Gets the MSI transaction Id. | ||
1912 | /// </summary> | ||
1913 | public string TransactionId | ||
1914 | { | ||
1915 | get { return this.transactionId; } | ||
1916 | } | ||
1917 | } | ||
1918 | |||
1919 | /// <summary> | ||
1920 | /// Additional arguments passed by the engine after committing an MSI transaction. | ||
1921 | /// </summary> | ||
1922 | [Serializable] | ||
1923 | public class CommitMsiTransactionCompleteEventArgs : StatusEventArgs | ||
1924 | { | ||
1925 | private string transactionId; | ||
1926 | |||
1927 | /// <summary> | ||
1928 | /// | ||
1929 | /// </summary> | ||
1930 | /// <param name="transactionId"></param> | ||
1931 | /// <param name="hrStatus"></param> | ||
1932 | public CommitMsiTransactionCompleteEventArgs(string transactionId, int hrStatus) | ||
1933 | : base(hrStatus) | ||
1934 | { | ||
1935 | this.transactionId = transactionId; | ||
1936 | } | ||
1937 | |||
1938 | /// <summary> | ||
1939 | /// Gets the MSI transaction Id. | ||
1940 | /// </summary> | ||
1941 | public string TransactionId | ||
1942 | { | ||
1943 | get { return this.transactionId; } | ||
1944 | } | ||
1945 | } | ||
1946 | |||
1947 | /// <summary> | ||
1948 | /// Additional arguments passed by the engine before rolling back an MSI transaction. | ||
1949 | /// </summary> | ||
1950 | [Serializable] | ||
1951 | public class RollbackMsiTransactionBeginEventArgs : HResultEventArgs | ||
1952 | { | ||
1953 | private string transactionId; | ||
1954 | |||
1955 | /// <summary> | ||
1956 | /// | ||
1957 | /// </summary> | ||
1958 | /// <param name="transactionId"></param> | ||
1959 | public RollbackMsiTransactionBeginEventArgs(string transactionId) | ||
1960 | { | ||
1961 | this.transactionId = transactionId; | ||
1962 | } | ||
1963 | |||
1964 | /// <summary> | ||
1965 | /// Gets the MSI transaction Id. | ||
1966 | /// </summary> | ||
1967 | public string TransactionId | ||
1968 | { | ||
1969 | get { return this.transactionId; } | ||
1970 | } | ||
1971 | } | ||
1972 | |||
1973 | /// <summary> | ||
1974 | /// Additional arguments passed by the engine after rolling back an MSI transaction. | ||
1975 | /// </summary> | ||
1976 | [Serializable] | ||
1977 | public class RollbackMsiTransactionCompleteEventArgs : StatusEventArgs | ||
1978 | { | ||
1979 | private string transactionId; | ||
1980 | |||
1981 | /// <summary> | ||
1982 | /// | ||
1983 | /// </summary> | ||
1984 | /// <param name="transactionId"></param> | ||
1985 | /// <param name="hrStatus"></param> | ||
1986 | public RollbackMsiTransactionCompleteEventArgs(string transactionId, int hrStatus) | ||
1987 | : base(hrStatus) | ||
1988 | { | ||
1989 | this.transactionId = transactionId; | ||
1990 | } | ||
1991 | |||
1992 | /// <summary> | ||
1993 | /// Gets the MSI transaction Id. | ||
1994 | /// </summary> | ||
1995 | public string TransactionId | ||
1996 | { | ||
1997 | get { return this.transactionId; } | ||
1998 | } | ||
1999 | } | ||
2000 | |||
2001 | /// <summary> | ||
2002 | /// Additional arguments passed by the engine before pausing Windows automatic updates. | ||
2003 | /// </summary> | ||
2004 | [Serializable] | ||
2005 | public class PauseAutomaticUpdatesBeginEventArgs : HResultEventArgs | ||
2006 | { | ||
2007 | /// <summary> | ||
2008 | /// | ||
2009 | /// </summary> | ||
2010 | public PauseAutomaticUpdatesBeginEventArgs() | ||
2011 | { | ||
2012 | } | ||
2013 | } | ||
2014 | |||
2015 | /// <summary> | ||
2016 | /// Additional arguments passed by the engine after pausing Windows automatic updates. | ||
2017 | /// </summary> | ||
2018 | [Serializable] | ||
2019 | public class PauseAutomaticUpdatesCompleteEventArgs : StatusEventArgs | ||
2020 | { | ||
2021 | /// <summary> | ||
2022 | /// | ||
2023 | /// </summary> | ||
2024 | /// <param name="hrStatus"></param> | ||
2025 | public PauseAutomaticUpdatesCompleteEventArgs(int hrStatus) | ||
2026 | : base(hrStatus) | ||
2027 | { | ||
2028 | } | ||
2029 | } | ||
2030 | |||
2031 | /// <summary> | ||
2032 | /// Additional arguments passed by the engine before taking a system restore point. | ||
2033 | /// </summary> | ||
2034 | [Serializable] | ||
2035 | public class SystemRestorePointBeginEventArgs : HResultEventArgs | ||
2036 | { | ||
2037 | /// <summary> | ||
2038 | /// | ||
2039 | /// </summary> | ||
2040 | public SystemRestorePointBeginEventArgs() | ||
2041 | { | ||
2042 | } | ||
2043 | } | ||
2044 | |||
2045 | /// <summary> | ||
2046 | /// Additional arguments passed by the engine after taking a system restore point. | ||
2047 | /// </summary> | ||
2048 | [Serializable] | ||
2049 | public class SystemRestorePointCompleteEventArgs : StatusEventArgs | ||
2050 | { | ||
2051 | /// <summary> | ||
2052 | /// | ||
2053 | /// </summary> | ||
2054 | /// <param name="hrStatus"></param> | ||
2055 | public SystemRestorePointCompleteEventArgs(int hrStatus) | ||
2056 | : base(hrStatus) | ||
2057 | { | ||
2058 | } | ||
2059 | } | ||
2060 | |||
2061 | /// <summary> | ||
2062 | /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheContainerOrPayloadVerifyBegin"/>. | ||
2063 | /// </summary> | ||
2064 | [Serializable] | ||
2065 | public class CacheContainerOrPayloadVerifyBeginEventArgs : CancellableHResultEventArgs | ||
2066 | { | ||
2067 | /// <summary /> | ||
2068 | public CacheContainerOrPayloadVerifyBeginEventArgs(string packageOrContainerId, string payloadId, bool cancelRecommendation) | ||
2069 | : base(cancelRecommendation) | ||
2070 | { | ||
2071 | this.PackageOrContainerId = packageOrContainerId; | ||
2072 | this.PayloadId = payloadId; | ||
2073 | } | ||
2074 | |||
2075 | /// <summary> | ||
2076 | /// Gets the identifier of the container or package. | ||
2077 | /// </summary> | ||
2078 | public string PackageOrContainerId { get; private set; } | ||
2079 | |||
2080 | /// <summary> | ||
2081 | /// Gets the identifier of the payload. | ||
2082 | /// </summary> | ||
2083 | public string PayloadId { get; private set; } | ||
2084 | } | ||
2085 | |||
2086 | /// <summary> | ||
2087 | /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheContainerOrPayloadVerifyProgress"/>. | ||
2088 | /// </summary> | ||
2089 | [Serializable] | ||
2090 | public class CacheContainerOrPayloadVerifyProgressEventArgs : CacheProgressBaseEventArgs | ||
2091 | { | ||
2092 | /// <summary /> | ||
2093 | public CacheContainerOrPayloadVerifyProgressEventArgs(string packageOrContainerId, string payloadId, long progress, long total, int overallPercentage, bool cancelRecommendation) | ||
2094 | : base(packageOrContainerId, payloadId, progress, total, overallPercentage, cancelRecommendation) | ||
2095 | { | ||
2096 | } | ||
2097 | } | ||
2098 | |||
2099 | /// <summary> | ||
2100 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.CacheContainerOrPayloadVerifyComplete"/> | ||
2101 | /// </summary> | ||
2102 | [Serializable] | ||
2103 | public class CacheContainerOrPayloadVerifyCompleteEventArgs : StatusEventArgs | ||
2104 | { | ||
2105 | /// <summary /> | ||
2106 | public CacheContainerOrPayloadVerifyCompleteEventArgs(string packageOrContainerId, string payloadId, int hrStatus) | ||
2107 | : base(hrStatus) | ||
2108 | { | ||
2109 | this.PackageOrContainerId = packageOrContainerId; | ||
2110 | this.PayloadId = payloadId; | ||
2111 | } | ||
2112 | |||
2113 | /// <summary> | ||
2114 | /// Gets the identifier of the container or package. | ||
2115 | /// </summary> | ||
2116 | public string PackageOrContainerId { get; private set; } | ||
2117 | |||
2118 | /// <summary> | ||
2119 | /// Gets the identifier of the payload. | ||
2120 | /// </summary> | ||
2121 | public string PayloadId { get; private set; } | ||
2122 | } | ||
2123 | |||
2124 | /// <summary> | ||
2125 | /// EventArgs for <see cref="IDefaultBootstrapperApplication.CachePayloadExtractBegin"/>. | ||
2126 | /// </summary> | ||
2127 | [Serializable] | ||
2128 | public class CachePayloadExtractBeginEventArgs : CancellableHResultEventArgs | ||
2129 | { | ||
2130 | /// <summary /> | ||
2131 | public CachePayloadExtractBeginEventArgs(string containerId, string payloadId, bool cancelRecommendation) | ||
2132 | : base(cancelRecommendation) | ||
2133 | { | ||
2134 | this.ContainerId = containerId; | ||
2135 | this.PayloadId = payloadId; | ||
2136 | } | ||
2137 | |||
2138 | /// <summary> | ||
2139 | /// Gets the identifier of the container. | ||
2140 | /// </summary> | ||
2141 | public string ContainerId { get; private set; } | ||
2142 | |||
2143 | /// <summary> | ||
2144 | /// Gets the identifier of the payload. | ||
2145 | /// </summary> | ||
2146 | public string PayloadId { get; private set; } | ||
2147 | } | ||
2148 | |||
2149 | /// <summary> | ||
2150 | /// EventArgs for <see cref="IDefaultBootstrapperApplication.CachePayloadExtractProgress"/>. | ||
2151 | /// </summary> | ||
2152 | [Serializable] | ||
2153 | public class CachePayloadExtractProgressEventArgs : CacheProgressBaseEventArgs | ||
2154 | { | ||
2155 | /// <summary /> | ||
2156 | public CachePayloadExtractProgressEventArgs(string containerId, string payloadId, long progress, long total, int overallPercentage, bool cancelRecommendation) | ||
2157 | : base(containerId, payloadId, progress, total, overallPercentage, cancelRecommendation) | ||
2158 | { | ||
2159 | } | ||
2160 | } | ||
2161 | |||
2162 | /// <summary> | ||
2163 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.CachePayloadExtractComplete"/> | ||
2164 | /// </summary> | ||
2165 | [Serializable] | ||
2166 | public class CachePayloadExtractCompleteEventArgs : StatusEventArgs | ||
2167 | { | ||
2168 | /// <summary /> | ||
2169 | public CachePayloadExtractCompleteEventArgs(string containerId, string payloadId, int hrStatus) | ||
2170 | : base(hrStatus) | ||
2171 | { | ||
2172 | this.ContainerId = containerId; | ||
2173 | this.PayloadId = payloadId; | ||
2174 | } | ||
2175 | |||
2176 | /// <summary> | ||
2177 | /// Gets the identifier of the container. | ||
2178 | /// </summary> | ||
2179 | public string ContainerId { get; private set; } | ||
2180 | |||
2181 | /// <summary> | ||
2182 | /// Gets the identifier of the payload. | ||
2183 | /// </summary> | ||
2184 | public string PayloadId { get; private set; } | ||
2185 | } | ||
2186 | } | ||