-
Notifications
You must be signed in to change notification settings - Fork 693
/
Copy pathPackageDependencyMetadata.cs
43 lines (36 loc) · 1.06 KB
/
PackageDependencyMetadata.cs
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
// 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.Globalization;
using NuGet.Versioning;
namespace NuGet.PackageManagement.UI
{
public class PackageDependencyMetadata
{
public PackageDependencyMetadata()
{
}
public PackageDependencyMetadata(Packaging.Core.PackageDependency serverData)
{
Id = serverData.Id;
Range = serverData.VersionRange;
}
public string Id { get; }
public VersionRange Range { get; }
public PackageDependencyMetadata(string id, VersionRange range)
{
Id = id;
Range = range;
}
public override string ToString()
{
if (Range == null)
{
return Id;
}
return string.Format(
CultureInfo.InvariantCulture,
"{0} {1}",
Id, Range.PrettyPrint());
}
}
}