Пример #1
0
        public PackagesConfig TryReadPackagesConfig(VerifiedFolder folder)
        {
            var file = folder.GetRelativeFile("packages.config");

            if (file is VerifiedFile verifiedFile)
            {
                return(new PackagesConfig(verifiedFile, this));
            }
            else
            {
                return(null);
            }
        }
Пример #2
0
        public static void RevertAllCsProjAndPackagesConfigFiles(VerifiedFolder directory)
        {
            var csprojFile = directory.GetFiles()
                             .FirstOrDefault(f => f.FullName.EndsWith("csproj"));

            if (csprojFile != null)
            {
                RevertFileState(csprojFile);

                var packagesConfigFile = directory.GetRelativeFile("packages.config");
                RevertFileState(packagesConfigFile);
            }

            foreach (var folder in directory.GetDirectories())
            {
                RevertAllCsProjAndPackagesConfigFiles(folder);
            }
        }