NuGet.LocalPackageRepository.FileNameMatchesPattern C# (CSharp) Method

FileNameMatchesPattern() private static method

private static FileNameMatchesPattern ( string packageId, SemanticVersion version, string path ) : bool
packageId string
version SemanticVersion
path string
return bool
        private static bool FileNameMatchesPattern(string packageId, SemanticVersion version, string path)
        {
            var name = Path.GetFileNameWithoutExtension(path);
            SemanticVersion parsedVersion;

            // When matching by pattern, we will always have a version token. Packages without versions would be matched early on by the version-less path resolver 
            // when doing an exact match.
            return name.Length > packageId.Length &&
                   SemanticVersion.TryParse(name.Substring(packageId.Length + 1), out parsedVersion) &&
                   parsedVersion == version;
        }