示例#1
0
        private void ReplaceDllReferencesInProjectFiles(LinkToCommandArgs command, Link link)
        {
            var csprojs = GetProjectFiles(command);

            foreach (var csproj in csprojs)
            {
                PrintInspectingTextToUi(csproj);

                if (IsUnrecognizedProjectType(csproj))
                {
                    continue;
                }

                ReplaceDllReferencesInProject(csproj, link, command);
            }
        }
示例#2
0
        private void ReplaceDllReferencesInProject(FileInfo csproj, Link link, LinkToCommandArgs command)
        {
            var replacementRecords =
                _netFxCsproj.ReplaceReferencedNuGetDllsWithLinkDlls(csproj.FullName, link, command.Dlls);

            if (replacementRecords.Any())
            {
                foreach (var record in replacementRecords)
                {
                    PrintReplacementToUi(record);
                }
            }
            else
            {
                _ui.Indent()
                .Write("No changes", ConsoleColor.DarkGray)
                .End();
            }
        }
示例#3
0
 private IEnumerable <FileInfo> GetProjectFiles(LinkToCommandArgs command)
 {
     return(_filesystem.GetFilesByExtensionRecursively(command.DestinationDirectoryPath, "csproj"));
 }
示例#4
0
 private Link GetLink(LinkToCommandArgs command)
 {
     return(_linkRegistryFile.GetLink(command.LinkName));
 }