-
Notifications
You must be signed in to change notification settings - Fork 748
Expand file tree
/
Copy pathSourcePackageDependencyInfo.cs
More file actions
85 lines (77 loc) · 2.53 KB
/
SourcePackageDependencyInfo.cs
File metadata and controls
85 lines (77 loc) · 2.53 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using NuGet.Packaging.Core;
using NuGet.Versioning;
namespace NuGet.Protocol.Core.Types
{
public class SourcePackageDependencyInfo : PackageDependencyInfo
{
public SourcePackageDependencyInfo(
string id,
NuGetVersion version,
IEnumerable<PackageDependency> dependencies,
bool listed,
SourceRepository? source)
: this(
new PackageIdentity(id, version),
dependencies,
listed,
source,
downloadUri: null,
packageHash: null)
{
}
public SourcePackageDependencyInfo(
string id,
NuGetVersion version,
IEnumerable<PackageDependency> dependencies,
bool listed,
SourceRepository? source,
Uri? downloadUri,
string? packageHash)
: this(
new PackageIdentity(id, version),
dependencies,
listed,
source,
downloadUri,
packageHash)
{
}
public SourcePackageDependencyInfo(
PackageIdentity identity,
IEnumerable<PackageDependency> dependencies,
bool listed,
SourceRepository? source,
Uri? downloadUri,
string? packageHash)
: base(identity, dependencies)
{
Listed = listed;
Source = source;
DownloadUri = downloadUri;
PackageHash = packageHash;
}
/// <summary>
/// True if the package is listed and shown in search.
/// </summary>
/// <remarks>This property only applies to online sources.</remarks>
public bool Listed { get; }
/// <summary>
/// Source repository the dependency information was retrieved from.
/// </summary>
public SourceRepository? Source { get; }
/// <summary>
/// The HTTP, UNC, or local file URI to the package nupkg.
/// </summary>
/// <remarks>Optional</remarks>
public Uri? DownloadUri { get; }
/// <summary>
/// Package hash
/// </summary>
/// <remarks>Optional</remarks>
public string? PackageHash { get; }
}
}