Пример #1
0
 static IEnumerable <string> AddOldStyleDirectories(string directory)
 {
     foreach (var versionDirectory in DirectoryEx.EnumerateDirectoriesContains(directory, ".fody."))
     {
         var fileName    = Path.GetFileName(versionDirectory);
         var index       = fileName.IndexOf(".fody.", StringComparison.OrdinalIgnoreCase);
         var packageName = fileName.Substring(0, index + 5);
         yield return(GetAssemblyFromNugetDir(versionDirectory, packageName));
     }
 }
Пример #2
0
    static IEnumerable <AssemblyAndVersion> EnumerateOldStyleDirectories(string directory)
    {
        foreach (var versionDirectory in DirectoryEx.EnumerateDirectoriesContains(directory, ".fody."))
        {
            var fileName    = Path.GetFileName(versionDirectory);
            var index       = fileName.IndexOf(".fody.", StringComparison.OrdinalIgnoreCase);
            var packageName = fileName.Substring(0, index + 5);
            var version     = Version.Parse(fileName.Substring(index + 6).Split('-')[0]);

            yield return(new AssemblyAndVersion {
                Version = version, Assembly = GetAssemblyFromNugetDir(versionDirectory, packageName)
            });
        }
    }