Пример #1
0
 private async Task CodeEditorMenuItemCallbackAsync(CancellationToken cancellationToken)
 {
     try {
         await _codeConversion.PasteAsAsync <VBToCSConversion>(cancellationToken);
     } catch (Exception ex) {
         await VisualStudioInteraction.ShowExceptionAsync(ex);
     }
 }
 private async Task SolutionOrProjectMenuItemCallbackAsync(CancellationToken cancellationToken)
 {
     try {
         var projects = VisualStudioInteraction.GetSelectedProjectsAsync(ProjectExtension);
         await _codeConversion.ConvertProjectsAsync <CSToVBConversion>(await projects, cancellationToken);
     } catch (Exception ex) {
         await VisualStudioInteraction.ShowExceptionAsync(ex);
     }
 }
        private async Task ConvertDocumentAsync(string documentPath, Span selected, CancellationToken cancellationToken)
        {
            if (documentPath == null || !CodeConversion.IsCSFileName(documentPath))
            {
                return;
            }

            try {
                await _codeConversion.ConvertDocumentAsync <CSToVBConversion>(documentPath, selected, cancellationToken);
            } catch (Exception ex) {
                await VisualStudioInteraction.ShowExceptionAsync(ex);
            }
        }
Пример #4
0
        private async Task ConvertDocumentAsync(string documentPath, Span selected, CancellationToken cancellationToken)
        {
            if (documentPath == null || !CodeConversion.IsVBFileName(documentPath))
            {
                return;
            }

            try {
                await _codeConversion.ConvertDocumentAsync <VBToCSConversion>(documentPath, selected, cancellationToken);
            } catch (Exception ex) {
                await VisualStudioInteraction.ShowExceptionAsync(ServiceProvider, CodeConversion.ConverterTitle, ex);
            }
        }