using System; using System.Collections.Generic; using PortingAssistant.Client.Model; using PortingAssistant.Client.PortingProjectFile; namespace PortingAssistant.Client.Porting { public class PortingHandler : IPortingHandler { private readonly IPortingProjectFileHandler _portingProjectFileHandler; /// /// Create an Instance of a PortingHandler /// /// An ILogger object /// A instance of a handler object to run the porting public PortingHandler(IPortingProjectFileHandler portingProjectFileHandler) { _portingProjectFileHandler = portingProjectFileHandler; } /// /// Ports a list of projects /// /// List of projects paths /// Path to solution file /// Target framework to be used when porting /// List of key/value pairs where key is package and value is version number tuple /// A PortingProjectFileResult object, representing the result of the porting operation public List ApplyPortProjectFileChanges( List projects, string solutionPath, string targetFramework, Dictionary> upgradeVersions) { return ApplyPortProjectFileChanges(projects, solutionPath, targetFramework, true, upgradeVersions); } /// /// Ports a list of projects /// /// List of projects paths /// Path to solution file /// Target framework to be used when porting /// List of key/value pairs where key is package and value is version number tuple /// A PortingProjectFileResult object, representing the result of the porting operation public List ApplyPortProjectFileChanges( List projects, string solutionPath, string targetFramework, bool includeCodeFix, Dictionary> upgradeVersions, VisualStudioVersion? visualStudioVersion = null) { return _portingProjectFileHandler.ApplyProjectChanges(projects, solutionPath, targetFramework, includeCodeFix, upgradeVersions, visualStudioVersion); } } }