private async Task SolutionOrProjectMenuItemCallbackAsync(object sender, EventArgs e) { try { var projects = VisualStudioInteraction.GetSelectedProjectsAsync(ProjectExtension); await _codeConversion.PerformProjectConversionAsync <CSToVBConversion>(await projects); } catch (Exception ex) { await VisualStudioInteraction.ShowExceptionAsync(ServiceProvider, CodeConversion.ConverterTitle, ex); } }
private async Task SolutionOrProjectMenuItemCallbackAsync(CancellationToken cancellationToken) { try { var projects = VisualStudioInteraction.GetSelectedProjectsAsync(ProjectExtension); await _codeConversion.ConvertProjectsAsync <VBToCSConversion>(await projects, cancellationToken); } catch (Exception ex) { await VisualStudioInteraction.ShowExceptionAsync(ServiceProvider, CodeConversion.ConverterTitle, ex); } }
private async Task ConvertDocumentAsync(string documentPath, Span selected) { if (documentPath == null || !CodeConversion.IsCSFileName(documentPath)) { return; } try { await _codeConversion.PerformDocumentConversionAsync <CSToVBConversion>(documentPath, selected); } catch (Exception ex) { await VisualStudioInteraction.ShowExceptionAsync(ServiceProvider, CodeConversion.ConverterTitle, ex); } }
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); } }