-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathErrors.cs
More file actions
42 lines (36 loc) · 1.78 KB
/
Copy pathErrors.cs
File metadata and controls
42 lines (36 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// <copyright file="Errors.cs" company="Microsoft Corporation">
// Copyright (C) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt in the project root for license information.
// </copyright>
namespace Microsoft.VisualStudio.Setup
{
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Microsoft.VisualStudio.Setup.Configuration;
/// <summary>
/// Represents errors that occurred during the last install operation.
/// </summary>
public class Errors
{
private readonly IList<FailedPackageReference> failedPackages;
private readonly IList<PackageReference> skippedPackages;
/// <summary>
/// Initializes a new instance of the <see cref="Errors"/> class, internal only.
/// </summary>
/// <param name="errors">errors to initialize with.</param>
internal Errors(ISetupErrorState errors)
{
Validate.NotNull(errors, nameof(errors));
FailedPackages = Utilities.TrySetCollection(ref failedPackages, nameof(FailedPackages), errors.GetFailedPackages, PackageReferenceFactory.Create);
SkippedPackages = Utilities.TrySetCollection(ref skippedPackages, nameof(SkippedPackages), errors.GetSkippedPackages, PackageReferenceFactory.Create);
}
/// <summary>
/// Gets a collection of references to packages that failed to install.
/// </summary>
public ReadOnlyCollection<FailedPackageReference> FailedPackages { get; }
/// <summary>
/// Gets a collection of references to packages skipped because other packages in their parent workload or components failed.
/// </summary>
public ReadOnlyCollection<PackageReference> SkippedPackages { get; }
}
}