示例#1
0
        private bool UserHasConfirmedOverwrite(List <string> files, List <string> errors, string pathsToOverwrite)
        {
            return(VisualStudioInteraction.ShowMessageBox(_serviceProvider,
                                                          "Overwrite solution and referencing projects?",
                                                          $@"The current solution file and any referencing projects will be overwritten to reference the new project(s):
* {pathsToOverwrite}

The old contents will be copied to 'currentFilename.bak'.
Please 'Reload All' when Visual Studio prompts you.", true, files.Count > errors.Count));
        }
示例#2
0
        private bool UserHasConfirmedOverwrite(List <string> files, List <string> errors, IReadOnlyCollection <string> pathsToOverwrite)
        {
            var maxExamples = 30; // Avoid a huge unreadable dialog going off the screen
            var exampleText = pathsToOverwrite.Count > maxExamples ? $". First {maxExamples} examples" : "";

            return(VisualStudioInteraction.ShowMessageBox(_serviceProvider,
                                                          "Overwrite solution and referencing projects?",
                                                          $@"The current solution file and any referencing projects will be overwritten to reference the new project(s){exampleText}:
* {string.Join(Environment.NewLine + "* ", pathsToOverwrite.Take(maxExamples))}

The old contents will be copied to 'currentFilename.bak'.
Please 'Reload All' when Visual Studio prompts you.", true, files.Count > errors.Count));
        }
示例#3
0
        public async Task PerformDocumentConversion <TLanguageConversion>(string documentFilePath, Span selected) where TLanguageConversion : ILanguageConversion, new()
        {
            var conversionResult = await Task.Run(async() => {
                var result = await ConvertDocumentUnhandled <TLanguageConversion>(documentFilePath, selected);
                WriteConvertedFilesAndShowSummary(new[] { result });
                return(result);
            });

            if (GetOptions().CopyResultToClipboardForSingleDocument)
            {
                Clipboard.SetText(conversionResult.ConvertedCode ?? conversionResult.GetExceptionsAsString());
                _outputWindow.WriteToOutputWindow("Conversion result copied to clipboard.");
                VisualStudioInteraction.ShowMessageBox(_serviceProvider, "Conversion result copied to clipboard.", conversionResult.GetExceptionsAsString(), false);
            }
        }