public static bool TryParse(string version, out IVersionSpecification specification) { if (!VersionStringHelpers.IsVersionWellFormed(version)) { specification = null; return(false); } specification = new ExactVersionSpecification(version); return(true); }
public static bool TryParseVersionSpecification(string versionString, out IVersionSpecification specification) { if (string.IsNullOrEmpty(versionString)) { specification = null; return(false); } else if (versionString.Contains("-")) { return(RangeVersionSpecification.TryParse(versionString, out specification)); } else { return(ExactVersionSpecification.TryParse(versionString, out specification)); } }