MaxSatisfying() public method

Return the maximum version that satisfies this range.
public MaxSatisfying ( IEnumerable versions ) : System.Version
versions IEnumerable The versions to select from.
return System.Version
コード例 #1
0
ファイル: Range.cs プロジェクト: aleksandert/semver.net
 /// <summary>
 /// Return the maximum version that satisfies a given range.
 /// </summary>
 /// <param name="rangeSpec">The range specification.</param>
 /// <param name="versionStrings">The version strings to select from.</param>
 /// <param name="loose">When true, be more forgiving of some invalid version specifications.</param>
 /// <returns>The maximum satisfying version string, or null if no versions satisfied this range.</returns>
 public static string MaxSatisfying(string rangeSpec, IEnumerable<string> versionStrings, bool loose=false)
 {
     var range = new Range(rangeSpec);
     return range.MaxSatisfying(versionStrings);
 }
コード例 #2
0
ファイル: Range.cs プロジェクト: tomstreet/semver.net
        /// <summary>
        /// Return the maximum version that satisfies a given range.
        /// </summary>
        /// <param name="rangeSpec">The range specification.</param>
        /// <param name="versionStrings">The version strings to select from.</param>
        /// <param name="loose">When true, be more forgiving of some invalid version specifications.</param>
        /// <returns>The maximum satisfying version string, or null if no versions satisfied this range.</returns>
        public static string MaxSatisfying(string rangeSpec, IEnumerable <string> versionStrings, bool loose = false)
        {
            var range = new Range(rangeSpec);

            return(range.MaxSatisfying(versionStrings));
        }