예제 #1
0
        public async Task <ExtractInterfaceResult> ExtractInterfaceFromAnalyzedTypeAsync(
            ExtractInterfaceTypeAnalysisResult refactoringResult,
            ExtractInterfaceOptionsResult extractInterfaceOptions,
            CancellationToken cancellationToken)
        {
            var solution = refactoringResult.DocumentToExtractFrom.Project.Solution;

            var extractedInterfaceSymbol = CodeGenerationSymbolFactory.CreateNamedTypeSymbol(
                attributes: default,
 public ExtractInterfaceCodeAction(AbstractExtractInterfaceService extractInterfaceService, ExtractInterfaceTypeAnalysisResult typeAnalysisResult)
 {
     _extractInterfaceService = extractInterfaceService;
     _typeAnalysisResult      = typeAnalysisResult;
 }
예제 #3
0
        public async Task <ExtractInterfaceResult> ExtractInterfaceFromAnalyzedTypeAsync(ExtractInterfaceTypeAnalysisResult refactoringResult, CancellationToken cancellationToken)
        {
            var containingNamespaceDisplay = refactoringResult.TypeToExtractFrom.ContainingNamespace.IsGlobalNamespace
                ? string.Empty
                : refactoringResult.TypeToExtractFrom.ContainingNamespace.ToDisplayString();

            var extractInterfaceOptions = await GetExtractInterfaceOptionsAsync(
                refactoringResult.DocumentToExtractFrom,
                refactoringResult.TypeToExtractFrom,
                refactoringResult.ExtractableMembers,
                containingNamespaceDisplay,
                cancellationToken).ConfigureAwait(false);

            if (extractInterfaceOptions.IsCancelled)
            {
                return(new ExtractInterfaceResult(succeeded: false));
            }

            return(await ExtractInterfaceFromAnalyzedTypeAsync(refactoringResult, extractInterfaceOptions, cancellationToken).ConfigureAwait(false));
        }