示例#1
0
 public static Func <IPackage, bool> ToDelegate(this VersionRange versionInfo)
 {
     if (versionInfo == null)
     {
         throw new ArgumentNullException("versionInfo");
     }
     return(versionInfo.ToDelegate <IPackage>(p => p.Version));
 }
示例#2
0
 /// <summary>
 /// Determines if the specified version is within the version spec
 /// </summary>
 public static bool Satisfies(this VersionRange versionSpec, SemanticVersion version)
 {
     // The range is unbounded so return true
     if (versionSpec == null)
     {
         return(true);
     }
     return(versionSpec.ToDelegate <SemanticVersion>(v => v)(version));
 }
示例#3
0
        public static IEnumerable <IPackage> FindByVersion(this IEnumerable <IPackage> source, VersionRange versionSpec)
        {
            if (versionSpec == null)
            {
                throw new ArgumentNullException("versionSpec");
            }

            return(source.Where(versionSpec.ToDelegate()));
        }