Ejemplo n.º 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));
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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()));
        }