static void Convert(Solution newSolution, List<string> projectFiles) { PrjxToSolutionProject.Conversion conversion = new PrjxToSolutionProject.Conversion(); foreach (string path in projectFiles) { string name = PrjxToSolutionProject.Conversion.GetProjectName(path); conversion.NameToGuid[name] = Guid.NewGuid(); if (IsVisualBasic(path)) conversion.NameToPath[name] = Path.ChangeExtension(path, ".vbproj"); else conversion.NameToPath[name] = Path.ChangeExtension(path, ".csproj"); } foreach (string path in projectFiles) { conversion.IsVisualBasic = IsVisualBasic(path); IProject newProject = PrjxToSolutionProject.ConvertOldProject(path, conversion, newSolution); newSolution.AddFolder(newProject); } if (conversion.Resources != null) { const string resourceWarning = "${res:SharpDevelop.Solution.ImportResourceWarning}"; if (conversion.Resources.Count == 0) { MessageService.ShowMessage(resourceWarning); } else { StringBuilder txt = new StringBuilder(resourceWarning); txt.AppendLine(); txt.AppendLine(); txt.AppendLine("${res:SharpDevelop.Solution.ImportResourceWarningErrorText}"); foreach (string r in conversion.Resources) txt.AppendLine(r); MessageService.ShowMessage(txt.ToString()); } } newSolution.Save(); }
static void Convert(Solution newSolution, List <string> projectFiles) { PrjxToSolutionProject.Conversion conversion = new PrjxToSolutionProject.Conversion(); foreach (string path in projectFiles) { string name = PrjxToSolutionProject.Conversion.GetProjectName(path); conversion.NameToGuid[name] = Guid.NewGuid(); if (IsVisualBasic(path)) { conversion.NameToPath[name] = Path.ChangeExtension(path, ".vbproj"); } else { conversion.NameToPath[name] = Path.ChangeExtension(path, ".csproj"); } } foreach (string path in projectFiles) { conversion.IsVisualBasic = IsVisualBasic(path); IProject newProject = PrjxToSolutionProject.ConvertOldProject(path, conversion, newSolution); newSolution.AddFolder(newProject); } if (conversion.Resources != null) { const string resourceWarning = "${res:SharpDevelop.Solution.ImportResourceWarning}"; if (conversion.Resources.Count == 0) { MessageService.ShowMessage(resourceWarning); } else { StringBuilder txt = new StringBuilder(resourceWarning); txt.AppendLine(); txt.AppendLine(); txt.AppendLine("${res:SharpDevelop.Solution.ImportResourceWarningErrorText}"); foreach (string r in conversion.Resources) { txt.AppendLine(r); } MessageService.ShowMessage(txt.ToString()); } } newSolution.Save(); }