Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
PackageVersionExtensions.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 namespace SiliconStudio.Assets
4 {
5  internal static class PackageVersionExtensions
6  {
7 
8  public static NuGet.SemanticVersion ToSemanticVersion(this PackageVersion version)
9  {
10  return version == null ? null : new NuGet.SemanticVersion(version.ToString());
11  }
12 
13 
14  public static NuGet.IVersionSpec ToVersionSpec(this PackageVersionRange versionRange)
15  {
16  return versionRange == null
17  ? null
18  : new NuGet.VersionSpec()
19  {
20  MinVersion = versionRange.MinVersion != null ? versionRange.MinVersion.ToSemanticVersion() : null,
21  IsMinInclusive = versionRange.IsMinInclusive,
22  MaxVersion = versionRange.MaxVersion != null ? versionRange.MaxVersion.ToSemanticVersion() : null,
23  IsMaxInclusive = versionRange.IsMaxInclusive
24  };
25  }
26  }
27 }